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:
@@ -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();
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user