Skip to content

Commit

Permalink
dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
hkyip committed Sep 23, 2016
1 parent cca4b25 commit 1c578d4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 35 deletions.
72 changes: 38 additions & 34 deletions dist/angular-chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,40 @@
}
})();

(function() {
angular.module('angular.chips')
.factory('DomUtil', function() {
return DomUtil;
});
/*Dom related functionality*/
function DomUtil(element) {
/*
* addclass will append class to the given element
* ng-class will do the same functionality, in our case
* we don't have access to scope so we are using this util methods
*/
var utilObj = {};

utilObj.addClass = function(className) {
utilObj.removeClass(element, className);
element.attr('class', element.attr('class') + ' ' + className);
return utilObj;
};

utilObj.removeClass = function(className) {
var classes = element.attr('class').split(' ');
var classIndex = classes.indexOf(className);
if (classIndex !== -1) {
classes.splice(classIndex, 1);
}
element.attr('class', classes.join(' '));
return utilObj;
};

return utilObj;
}
})();

(function() {
angular.module('angular.chips')
.directive('chipTmpl', ChipTmpl);
Expand Down Expand Up @@ -358,40 +392,6 @@
}
})();

(function() {
angular.module('angular.chips')
.factory('DomUtil', function() {
return DomUtil;
});
/*Dom related functionality*/
function DomUtil(element) {
/*
* addclass will append class to the given element
* ng-class will do the same functionality, in our case
* we don't have access to scope so we are using this util methods
*/
var utilObj = {};

utilObj.addClass = function(className) {
utilObj.removeClass(element, className);
element.attr('class', element.attr('class') + ' ' + className);
return utilObj;
};

utilObj.removeClass = function(className) {
var classes = element.attr('class').split(' ');
var classIndex = classes.indexOf(className);
if (classIndex !== -1) {
classes.splice(classIndex, 1);
}
element.attr('class', classes.join(' '));
return utilObj;
};

return utilObj;
}
})();

(function() {
ChipControlLinkFun.$inject = ["scope", "iElement", "iAttrs", "chipsCtrl"];
angular.module('angular.chips')
Expand Down Expand Up @@ -423,6 +423,10 @@
});
iElement.on('blur', function() {
chipsCtrl.setFocus(false);
if (event.target.value !== '') {
chipsCtrl.addChip(event.target.value);
event.target.value = "";
}
});
};
})();
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-chips.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1c578d4

Please sign in to comment.