Skip to content

Commit

Permalink
chore(CONTRIBUTING): add contributing document
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronroberson committed Jan 25, 2016
1 parent 9f0e330 commit b0257e7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dist/select.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* ui-select
* http://github.com/angular-ui/ui-select
* Version: 0.13.2 - 2016-01-25T20:04:10.293Z
* Version: 0.13.3 - 2016-01-25T21:42:48.097Z
* License: MIT
*/

Expand Down
26 changes: 17 additions & 9 deletions dist/select.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/*!
* ui-select
* http://github.com/angular-ui/ui-select
* Version: 0.13.2 - 2016-01-25T20:04:10.175Z
* Version: 0.13.3 - 2016-01-25T21:42:48.011Z
* License: MIT
*/


(function () {
"use strict";

var KEY = {
TAB: 9,
ENTER: 13,
Expand Down Expand Up @@ -55,6 +54,13 @@ var KEY = {
},
isHorizontalMovement: function (k){
return ~[KEY.LEFT,KEY.RIGHT,KEY.BACKSPACE,KEY.DELETE].indexOf(k);
},
toSeparator: function (k) {
var sep = {ENTER:"\n",TAB:"\t",SPACE:" "}[k];
if (sep) return sep;
// return undefined for special keys other than enter, tab or space.
// no way to use them to cut strings.
return KEY[k] ? undefined : k;
}
};

Expand Down Expand Up @@ -508,7 +514,7 @@ uis.controller('uiSelectCtrl',
ctrl.select = function(item, skipFocusser, $event) {
if (item === undefined || !item._uiSelectChoiceDisabled) {

if ( ! ctrl.items && ! ctrl.search ) return;
if ( ! ctrl.items && ! ctrl.search && ! ctrl.tagging.isActivated) return;

if (!item || !item._uiSelectChoiceDisabled) {
if(ctrl.tagging.isActivated) {
Expand Down Expand Up @@ -733,15 +739,17 @@ uis.controller('uiSelectCtrl',
// If tagging try to split by tokens and add items
ctrl.searchInput.on('paste', function (e) {
var data = e.originalEvent.clipboardData.getData('text/plain');
if (data && data.length > 0 && ctrl.taggingTokens.isActivated && ctrl.tagging.fct) {
var items = data.split(ctrl.taggingTokens.tokens[0]); // split by first token only
if (data && data.length > 0 && ctrl.taggingTokens.isActivated) {
// split by first token only
var separator = KEY.toSeparator(ctrl.taggingTokens.tokens[0]);
var items = data.split(separator);
if (items && items.length > 0) {
var oldsearch = ctrl.search;
angular.forEach(items, function (item) {
var newItem = ctrl.tagging.fct(item);
if (newItem) {
ctrl.select(newItem, true);
}
ctrl.search = item;
ctrl.select(item, true);
});
ctrl.search = oldsearch;
e.preventDefault();
e.stopPropagation();
}
Expand Down
2 changes: 1 addition & 1 deletion dist/select.min.css

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

4 changes: 2 additions & 2 deletions dist/select.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
],

// List of files to exclude
exclude: [],
exclude: ['./index.js'],

// Web server port
port: 9876,
Expand Down
5 changes: 0 additions & 5 deletions src/common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'ui.select';
}

var KEY = {
TAB: 9,
ENTER: 13,
Expand Down

0 comments on commit b0257e7

Please sign in to comment.