Switch the old checkbox to use the umb-toggle directive in the views instead. Added a toggle function to deal with this in each of the two controllers
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
vm.addChild = addChild;
|
||||
vm.removeChild = removeChild;
|
||||
vm.toggle = toggle;
|
||||
|
||||
/* ---------- INIT ---------- */
|
||||
|
||||
@@ -75,6 +76,18 @@
|
||||
$scope.model.allowedContentTypes.splice(selectedChildIndex, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the $scope.model.allowAsRoot value to either true or false
|
||||
*/
|
||||
function toggle(){
|
||||
if($scope.model.allowAsRoot){
|
||||
$scope.model.allowAsRoot = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.model.allowAsRoot = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.DocumentType.PermissionsController", PermissionsController);
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
<small><localize key="contentTypeEditor_allowAsRootDescription" /></small>
|
||||
</div>
|
||||
<div class="sub-view-column-right">
|
||||
<label class="checkbox no-indent" >
|
||||
<input type="checkbox" ng-model="model.allowAsRoot" hotkey="alt+shift+r" />
|
||||
<localize key="contentTypeEditor_allowAsRootCheckbox" />
|
||||
</label>
|
||||
<umb-toggle
|
||||
checked="model.allowAsRoot"
|
||||
on-click="vm.toggle()"
|
||||
hotkey="alt+shift+r"
|
||||
>
|
||||
</umb-toggle>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
vm.addChild = addChild;
|
||||
vm.removeChild = removeChild;
|
||||
vm.toggle = toggle;
|
||||
|
||||
/* ---------- INIT ---------- */
|
||||
|
||||
@@ -65,6 +66,18 @@
|
||||
$scope.model.allowedContentTypes.splice(selectedChildIndex, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the $scope.model.allowAsRoot value to either true or false
|
||||
*/
|
||||
function toggle(){
|
||||
if($scope.model.allowAsRoot){
|
||||
$scope.model.allowAsRoot = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.model.allowAsRoot = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.MediaType.PermissionsController", PermissionsController);
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
<small><localize key="contentTypeEditor_allowAsRootDescription" /></small>
|
||||
</div>
|
||||
<div class="sub-view-column-right">
|
||||
<label class="checkbox no-indent" >
|
||||
<input type="checkbox" ng-model="model.allowAsRoot" hotkey="alt+shift+r" />
|
||||
<localize key="contentTypeEditor_allowAsRootCheckbox" />
|
||||
</label>
|
||||
<umb-toggle
|
||||
checked="model.allowAsRoot"
|
||||
on-click="vm.toggle()"
|
||||
hotkey="alt+shift+r"
|
||||
>
|
||||
</umb-toggle>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user