From b1be0f2dae9026399c00f431306ba55040d1ba6e Mon Sep 17 00:00:00 2001 From: Jan Skovgaard Date: Wed, 13 Jun 2018 20:55:52 +0200 Subject: [PATCH] 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. --- .../components/umblistviewsettings.directive.js | 15 +++++++++++---- .../views/components/umb-list-view-settings.html | 8 +++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umblistviewsettings.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umblistviewsettings.directive.js index f21f7b8d3d..26583b108b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umblistviewsettings.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umblistviewsettings.directive.js @@ -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(); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-list-view-settings.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-list-view-settings.html index 5afd3012eb..356864546a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-list-view-settings.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-list-view-settings.html @@ -1,9 +1,11 @@
-