From 73eed609b395ceb458a654ee038b334558b33ec3 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Mon, 13 Oct 2014 21:23:41 +0800 Subject: [PATCH] Fix result profiles state calculation in OmegaTarget. --- omega-target/src/options.coffee | 4 ++-- omega-web/src/popup.jade | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/omega-target/src/options.coffee b/omega-target/src/options.coffee index b49e61f..55d01bd 100644 --- a/omega-target/src/options.coffee +++ b/omega-target/src/options.coffee @@ -288,8 +288,8 @@ class Options profileType: profile.profileType color: profile.color builtin: !!profile.builtin - if results? and currentIncludable - results.push(profile.name) + if currentIncludable and OmegaPac.Profiles.isIncludable(profile) + results?.push(profile.name) if profile and OmegaPac.Profiles.isInclusive(profile) results = OmegaPac.Profiles.validResultProfilesFor(profile, @_options) results = results.map (profile) -> profile.name diff --git a/omega-web/src/popup.jade b/omega-web/src/popup.jade index 34e712e..49c6ea0 100644 --- a/omega-web/src/popup.jade +++ b/omega-web/src/popup.jade @@ -51,20 +51,21 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp) span {{'popup_externalProfile' | tr}} input.external-profile-name.input-small(type='text' style='display: none' placeholder='{{"popup_externalProfileName" | tr}}') - li.divider(ng-show='!!currentDomain') + li.divider(ng-show='!!currentDomain && validResultProfiles.length') li(ng-show='!!currentProfileCanAddRule') a(ng-click='showConditionForm = true') span.glyphicon.glyphicon-plus = ' ' span {{'popup_addCondition' | tr}} - li(ng-show='!!currentDomain' dropdown is-open="tempRuleMenu.open") + li(ng-show='!!currentDomain && validResultProfiles.length' dropdown is-open="tempRuleMenu.open") a.dropdown-toggle span.glyphicon.glyphicon-filter = ' ' span.current-domain {{currentDomain}} span.caret ul.dropdown-menu - li(ng-repeat='profile in validResultProfiles' ng-class='{active: profile.name == currentTempRuleProfile}') + li(ng-repeat='profile in validResultProfiles' ng-class='{active: profile.name == currentTempRuleProfile}' + ng-show='!!currentTempRuleProfile || validResultProfiles.length == 1 || profile.name != currentProfileName') a(ng-click='addTempRule(currentDomain, profile.name)') span.glyphicon(ng-style='{color: profile.color}' class='{{profileIcons[profile.profileType]}}')