Replaced the old checkbox with the umb-toggle button. It behaves the same as before but looks nicer :-) - Also removed some unsued references from the code in the directive.

This commit is contained in:
Jan Skovgaard
2018-06-13 20:55:52 +02:00
parent 3520f2d1e4
commit b08343fe76
2 changed files with 16 additions and 7 deletions

View File

@@ -1,9 +1,9 @@
(function() {
'use strict';
function ListViewSettingsDirective(contentTypeResource, dataTypeResource, dataTypeHelper, listViewPrevalueHelper) {
function ListViewSettingsDirective(dataTypeResource, dataTypeHelper, listViewPrevalueHelper) {
function link(scope, el, attr, ctrl) {
function link(scope) {
scope.dataType = {};
scope.editDataTypeSettings = false;
@@ -22,7 +22,6 @@
listViewPrevalueHelper.setPrevalues(dataType.preValues);
scope.customListViewCreated = checkForCustomListView();
});
} else {
@@ -111,8 +110,16 @@
};
scope.toggle = function(){
if(scope.enableListView){
scope.enableListView = false;
return;
}
scope.enableListView = true;
};
/* ----------- SCOPE WATCHERS ----------- */
var unbindEnableListViewWatcher = scope.$watch('enableListView', function(newValue, oldValue){
var unbindEnableListViewWatcher = scope.$watch('enableListView', function(newValue){
if(newValue !== undefined) {
activate();

View File

@@ -1,9 +1,11 @@
<div class="umb-list-view-settings">
<div class="umb-list-view-settings__trigger">
<label class="checkbox no-indent">
<input type="checkbox" ng-model="enableListView" hotkey="alt+shift+l" />
<localize key="general_yes"></localize> - <localize key="contentTypeEditor_enableListViewHeading"></localize>
<umb-toggle
checked="enableListView"
on-click="toggle()"
hotkey="alt+shift+l">
</umb-toggle>
</div>
<!-- list view enabled -->