Skip to content

Commit ffbda69

Browse files
author
Niels Dequeker
committed
New build
1 parent cbf7302 commit ffbda69

File tree

1 file changed

+146
-146
lines changed

1 file changed

+146
-146
lines changed

dist/angular-ui-tree.js

Lines changed: 146 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -358,128 +358,128 @@
358358
'use strict';
359359

360360
angular.module('ui.tree')
361-
.directive('uiTree', [ 'treeConfig', '$window',
362-
function(treeConfig, $window) {
363-
return {
364-
restrict: 'A',
365-
scope: true,
366-
controller: 'TreeController',
367-
link: function(scope, element, attrs) {
368-
var callbacks = {
369-
accept: null,
370-
beforeDrag: null
371-
};
361+
.directive('uiTree', [ 'treeConfig', '$window',
362+
function(treeConfig, $window) {
363+
return {
364+
restrict: 'A',
365+
scope: true,
366+
controller: 'TreeController',
367+
link: function(scope, element, attrs) {
368+
var callbacks = {
369+
accept: null,
370+
beforeDrag: null
371+
};
372+
373+
var config = {};
374+
angular.extend(config, treeConfig);
375+
if (config.treeClass) {
376+
element.addClass(config.treeClass);
377+
}
372378

373-
var config = {};
374-
angular.extend(config, treeConfig);
375-
if (config.treeClass) {
376-
element.addClass(config.treeClass);
377-
}
379+
scope.$emptyElm = angular.element($window.document.createElement('div'));
380+
if (config.emptyTreeClass) {
381+
scope.$emptyElm.addClass(config.emptyTreeClass);
382+
}
378383

379-
scope.$emptyElm = angular.element($window.document.createElement('div'));
380-
if (config.emptyTreeClass) {
381-
scope.$emptyElm.addClass(config.emptyTreeClass);
384+
scope.$watch('$nodesScope.$modelValue.length', function() {
385+
if (scope.$nodesScope.$modelValue) {
386+
scope.resetEmptyElement();
382387
}
388+
}, true);
383389

384-
scope.$watch('$nodesScope.$modelValue.length', function() {
385-
if (scope.$nodesScope.$modelValue) {
386-
scope.resetEmptyElement();
387-
}
388-
}, true);
389-
390-
scope.$watch(attrs.dragEnabled, function(val) {
391-
if((typeof val) == "boolean") {
392-
scope.dragEnabled = val;
393-
}
394-
});
395-
396-
scope.$watch(attrs.emptyPlaceHolderEnabled, function(val) {
397-
if((typeof val) == "boolean") {
398-
scope.emptyPlaceHolderEnabled = val;
399-
}
400-
});
390+
scope.$watch(attrs.dragEnabled, function(val) {
391+
if((typeof val) == "boolean") {
392+
scope.dragEnabled = val;
393+
}
394+
});
401395

402-
scope.$watch(attrs.nodropEnabled, function(val) {
403-
if((typeof val) == "boolean") {
404-
scope.nodropEnabled = val;
405-
}
406-
});
396+
scope.$watch(attrs.emptyPlaceHolderEnabled, function(val) {
397+
if((typeof val) == "boolean") {
398+
scope.emptyPlaceHolderEnabled = val;
399+
}
400+
});
407401

408-
scope.$watch(attrs.cloneEnabled, function(val) {
409-
if((typeof val) == "boolean") {
410-
scope.cloneEnabled = val;
411-
}
412-
});
402+
scope.$watch(attrs.nodropEnabled, function(val) {
403+
if((typeof val) == "boolean") {
404+
scope.nodropEnabled = val;
405+
}
406+
});
413407

414-
scope.$watch(attrs.maxDepth, function(val) {
415-
if((typeof val) == "number") {
416-
scope.maxDepth = val;
417-
}
418-
});
408+
scope.$watch(attrs.cloneEnabled, function(val) {
409+
if((typeof val) == "boolean") {
410+
scope.cloneEnabled = val;
411+
}
412+
});
419413

420-
scope.$watch(attrs.dragDelay, function(val) {
421-
if((typeof val) == "number") {
422-
scope.dragDelay = val;
423-
}
424-
});
414+
scope.$watch(attrs.maxDepth, function(val) {
415+
if((typeof val) == "number") {
416+
scope.maxDepth = val;
417+
}
418+
});
425419

426-
// check if the dest node can accept the dragging node
427-
// by default, we check the 'data-nodrop-enabled' attribute in `ui-tree-nodes`
428-
// and the 'max-depth' attribute in `ui-tree` or `ui-tree-nodes`.
429-
// the method can be overrided
430-
callbacks.accept = function(sourceNodeScope, destNodesScope, destIndex) {
431-
if (destNodesScope.nodropEnabled || destNodesScope.outOfDepth(sourceNodeScope)) {
432-
return false;
433-
}
434-
return true;
435-
};
420+
scope.$watch(attrs.dragDelay, function(val) {
421+
if((typeof val) == "number") {
422+
scope.dragDelay = val;
423+
}
424+
});
436425

437-
callbacks.beforeDrag = function(sourceNodeScope) {
438-
return true;
439-
};
426+
// check if the dest node can accept the dragging node
427+
// by default, we check the 'data-nodrop-enabled' attribute in `ui-tree-nodes`
428+
// and the 'max-depth' attribute in `ui-tree` or `ui-tree-nodes`.
429+
// the method can be overrided
430+
callbacks.accept = function(sourceNodeScope, destNodesScope, destIndex) {
431+
if (destNodesScope.nodropEnabled || destNodesScope.outOfDepth(sourceNodeScope)) {
432+
return false;
433+
}
434+
return true;
435+
};
440436

441-
callbacks.removed = function(node){
437+
callbacks.beforeDrag = function(sourceNodeScope) {
438+
return true;
439+
};
442440

443-
};
441+
callbacks.removed = function(node){
442+
443+
};
444444

445-
callbacks.dropped = function(event) {
445+
callbacks.dropped = function(event) {
446446

447-
};
447+
};
448448

449-
//
450-
callbacks.dragStart = function(event) {
449+
//
450+
callbacks.dragStart = function(event) {
451451

452-
};
452+
};
453453

454-
callbacks.dragMove = function(event) {
454+
callbacks.dragMove = function(event) {
455455

456-
};
456+
};
457457

458-
callbacks.dragStop = function(event) {
458+
callbacks.dragStop = function(event) {
459459

460-
};
460+
};
461461

462-
callbacks.beforeDrop = function(event) {
462+
callbacks.beforeDrop = function(event) {
463463

464-
};
464+
};
465465

466-
scope.$watch(attrs.uiTree, function(newVal, oldVal){
467-
angular.forEach(newVal, function(value, key){
468-
if (callbacks[key]) {
469-
if (typeof value === "function") {
470-
callbacks[key] = value;
471-
}
466+
scope.$watch(attrs.uiTree, function(newVal, oldVal){
467+
angular.forEach(newVal, function(value, key){
468+
if (callbacks[key]) {
469+
if (typeof value === "function") {
470+
callbacks[key] = value;
472471
}
473-
});
472+
}
473+
});
474474

475-
scope.$callbacks = callbacks;
476-
}, true);
475+
scope.$callbacks = callbacks;
476+
}, true);
477477

478478

479-
}
480-
};
481-
}
482-
]);
479+
}
480+
};
481+
}
482+
]);
483483
})();
484484

485485
(function () {
@@ -941,64 +941,64 @@
941941
'use strict';
942942

943943
angular.module('ui.tree')
944-
.directive('uiTreeNodes', [ 'treeConfig', '$window',
945-
function(treeConfig) {
946-
return {
947-
require: ['ngModel', '?^uiTreeNode', '^uiTree'],
948-
restrict: 'A',
949-
scope: true,
950-
controller: 'TreeNodesController',
951-
link: function(scope, element, attrs, controllersArr) {
944+
.directive('uiTreeNodes', [ 'treeConfig', '$window',
945+
function(treeConfig) {
946+
return {
947+
require: ['ngModel', '?^uiTreeNode', '^uiTree'],
948+
restrict: 'A',
949+
scope: true,
950+
controller: 'TreeNodesController',
951+
link: function(scope, element, attrs, controllersArr) {
952+
953+
var config = {};
954+
angular.extend(config, treeConfig);
955+
if (config.nodesClass) {
956+
element.addClass(config.nodesClass);
957+
}
952958

953-
var config = {};
954-
angular.extend(config, treeConfig);
955-
if (config.nodesClass) {
956-
element.addClass(config.nodesClass);
957-
}
959+
var ngModel = controllersArr[0];
960+
var treeNodeCtrl = controllersArr[1];
961+
var treeCtrl = controllersArr[2];
962+
if (treeNodeCtrl) {
963+
treeNodeCtrl.scope.$childNodesScope = scope;
964+
scope.$nodeScope = treeNodeCtrl.scope;
965+
}
966+
else { // find the root nodes if there is no parent node and have a parent ui-tree
967+
treeCtrl.scope.$nodesScope = scope;
968+
}
969+
scope.$treeScope = treeCtrl.scope;
958970

959-
var ngModel = controllersArr[0];
960-
var treeNodeCtrl = controllersArr[1];
961-
var treeCtrl = controllersArr[2];
962-
if (treeNodeCtrl) {
963-
treeNodeCtrl.scope.$childNodesScope = scope;
964-
scope.$nodeScope = treeNodeCtrl.scope;
965-
}
966-
else { // find the root nodes if there is no parent node and have a parent ui-tree
967-
treeCtrl.scope.$nodesScope = scope;
968-
}
969-
scope.$treeScope = treeCtrl.scope;
971+
if (ngModel) {
972+
ngModel.$render = function() {
973+
if (!ngModel.$modelValue || !angular.isArray(ngModel.$modelValue)) {
974+
scope.$modelValue = [];
975+
}
976+
scope.$modelValue = ngModel.$modelValue;
977+
};
978+
}
970979

971-
if (ngModel) {
972-
ngModel.$render = function() {
973-
if (!ngModel.$modelValue || !angular.isArray(ngModel.$modelValue)) {
974-
scope.$modelValue = [];
975-
}
976-
scope.$modelValue = ngModel.$modelValue;
977-
};
980+
scope.$watch(attrs.maxDepth, function(val) {
981+
if((typeof val) == "number") {
982+
scope.maxDepth = val;
978983
}
984+
});
979985

980-
scope.$watch(attrs.maxDepth, function(val) {
981-
if((typeof val) == "number") {
982-
scope.maxDepth = val;
983-
}
984-
});
985-
986-
scope.$watch(function () {
987-
return attrs.nodropEnabled;
988-
}, function (newVal) {
989-
if((typeof newVal) != "undefined") {
990-
scope.nodropEnabled = true;
991-
}
992-
}, true);
986+
scope.$watch(function () {
987+
return attrs.nodropEnabled;
988+
}, function (newVal) {
989+
if((typeof newVal) != "undefined") {
990+
scope.nodropEnabled = true;
991+
}
992+
}, true);
993993

994-
attrs.$observe('horizontal', function(val) {
995-
scope.horizontal = ((typeof val) != "undefined");
996-
});
994+
attrs.$observe('horizontal', function(val) {
995+
scope.horizontal = ((typeof val) != "undefined");
996+
});
997997

998-
}
999-
};
1000-
}
1001-
]);
998+
}
999+
};
1000+
}
1001+
]);
10021002
})();
10031003

10041004
(function () {

0 commit comments

Comments
 (0)