合并directive文件
This commit is contained in:
parent
f5e21d4840
commit
5bdacf3500
|
|
@ -44,11 +44,7 @@
|
|||
<script src="/scripts/services/bookmark-service.js"></script>
|
||||
<script src="/scripts/services/data-service.js"></script>
|
||||
<script src="/scripts/services/pub-sub-service.js"></script>
|
||||
<script src="/scripts/directives/pagination-directive.js"></script>
|
||||
<script src="/scripts/directives/edit-directive.js"></script>
|
||||
<script src="/scripts/directives/bookmark-info-directive.js"></script>
|
||||
<script src="/scripts/directives/menus-directive.js"></script>
|
||||
<script src="/scripts/directives/element-render-finish-directive.js"></script>
|
||||
<script src="/scripts/directives/module-directive.js"></script>
|
||||
<script src="/scripts/directives/js-init-directive.js"></script>
|
||||
<script src="/scripts/controllers/bookmarks-controller.js"></script>
|
||||
<script src="/scripts/controllers/home-controller.js"></script>
|
||||
|
|
|
|||
|
|
@ -176,23 +176,6 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p
|
|||
.catch((err) => console.log('getTags err', err));
|
||||
}
|
||||
|
||||
// 元素构造完成之后,开始使用jquery初始化
|
||||
$scope.$on('viewContentLoaded', function(elementRenderFinishedEvent) {
|
||||
console.log('edit ui dropdown viewContentLoaded')
|
||||
$('.ui.modal.js-add-bookmark .ui.dropdown').removeClass('loading');
|
||||
$('.ui.dropdown.js-tags').dropdown({
|
||||
forceSelection: false,
|
||||
maxSelections: maxSelections,
|
||||
action: 'combo',
|
||||
onChange: function(value, text, $choice) {
|
||||
var selectedTags = $('.ui.modal.js-add-bookmark .ui.dropdown').dropdown('get value');
|
||||
$timeout(function() {
|
||||
$scope.tagsError = (selectedTags.length == 0 || selectedTags.length > maxSelections) && ($('.ui.modal.js-add-bookmark').modal('is active'));
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function initJsTags() {
|
||||
setTimeout(function() {
|
||||
$('.ui.modal.js-add-bookmark .ui.dropdown').removeClass('loading');
|
||||
|
|
|
|||
|
|
@ -309,10 +309,12 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
toastr.info('您还没有书签分类,请点击菜单栏的添加按钮进行添加', "提示");
|
||||
}
|
||||
$scope.loadTags = false;
|
||||
updateEditPos();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('getTags err', err);
|
||||
$scope.loadTags = false;
|
||||
updateEditPos();
|
||||
});
|
||||
|
||||
pubSubService.publish('Common.menuActive', {
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
app.directive('bookmarkinfo', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/bookmark-info.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
app.directive('edit', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/edit.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
app.directive('onFinishRenderFilters', ['$timeout', function($timeout) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function(scope, element, attr) {
|
||||
if (scope.$last === true) {
|
||||
$timeout(function() {
|
||||
scope.$emit('elementRenderFinished');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
// 不要使用已有的html作为指令,如menu,否则angular会陷入死循环
|
||||
app.directive('menus', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/menus.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
app.directive('bookmarkinfo', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/bookmark-info.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
||||
app.directive('edit', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/edit.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
||||
// 不要使用已有的html作为指令,如menu,否则angular会陷入死循环
|
||||
app.directive('menus', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: '/views/menus.html',
|
||||
replace: true
|
||||
}
|
||||
});
|
||||
|
||||
app.directive('pagination', function() {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
templateUrl: '/views/pagination.html',
|
||||
replace: true,
|
||||
link: function(scope, element, attrs) {}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
// 不要使用已有的html作为指令,如menu,否则angular会陷入死循环
|
||||
app.directive('pagination', function() {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
templateUrl: '/views/pagination.html',
|
||||
replace: true,
|
||||
// scope: {
|
||||
// conf: '='
|
||||
// },
|
||||
link: function(scope, element, attrs) {}
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue