mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 23:08:13 -05:00
Parse source when switching states from switch profile. Fix #765.
This commit is contained in:
parent
497d5de8ce
commit
56d1e8c4d6
@ -395,6 +395,11 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $rootScope,
|
|||||||
$scope.loadRules = true
|
$scope.loadRules = true
|
||||||
omegaTarget.state(stateEditorKey, {editSource: $scope.editSource})
|
omegaTarget.state(stateEditorKey, {editSource: $scope.editSource})
|
||||||
|
|
||||||
|
$rootScope.$on '$stateChangeStart', (event, _, __, fromState) ->
|
||||||
|
if $scope.editSource and $scope.source.touched
|
||||||
|
sourceValid = parseSource()
|
||||||
|
event.preventDefault() unless sourceValid
|
||||||
|
|
||||||
$scope.$on 'omegaApplyOptions', (event) ->
|
$scope.$on 'omegaApplyOptions', (event) ->
|
||||||
if $scope.attached?.ruleList and not $scope.attached.sourceUrl
|
if $scope.attached?.ruleList and not $scope.attached.sourceUrl
|
||||||
$scope.attachedRuleListError = undefined
|
$scope.attachedRuleListError = undefined
|
||||||
|
Loading…
Reference in New Issue
Block a user