Refreshing the page in builtin profile bug #71

This commit is contained in:
proxy.zeroomega 2024-12-17 09:33:02 +08:00
parent c828be3984
commit 8740559d28

View File

@ -2,14 +2,24 @@ angular.module('omega').controller 'BuiltinCtrl', ($scope, $stateParams,
$location, $rootScope, $location, $rootScope,
$timeout, $state, $modal, $timeout, $state, $modal,
builtinProfiles, profileColorPalette, builtinProfiles, profileColorPalette,
getAttachedName, getParentName, getVirtualTarget getAttachedName, getParentName, getVirtualTarget,
omegaTarget
) -> ) ->
customBuiltinProfiles = Object.assign(
{}, builtinProfiles, $rootScope.options['-builtinProfiles'] customBuiltinProfiles = {}
)
#$rootScope.options['-builtinProfiles'] = customBuiltinProfiles decorateBuiltinProfile = (newOptions) ->
$scope.systemProfile = customBuiltinProfiles['+system'] Object.assign(
$scope.directProfile = customBuiltinProfiles['+direct'] customBuiltinProfiles,
builtinProfiles,
newOptions?['-builtinProfiles']
)
$scope.systemProfile = customBuiltinProfiles['+system']
$scope.directProfile = customBuiltinProfiles['+direct']
omegaTarget.addOptionsChangeCallback decorateBuiltinProfile
decorateBuiltinProfile($rootScope.options)
$scope.moveColor = (color, key) -> $scope.moveColor = (color, key) ->
customBuiltinProfiles[key].color = color customBuiltinProfiles[key].color = color
# make sure options watcher watch value changed # make sure options watcher watch value changed