Skip to content

Commit

Permalink
regenerate dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
ichord committed Jan 23, 2016
1 parent 2811196 commit d3d17b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 44 deletions.
2 changes: 0 additions & 2 deletions dist/css/jquery.atwho.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
border-radius: 3px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
min-width: 120px;
/*max-height: 200px;*/
/*overflow: auto;*/
z-index: 11110 !important;
}

Expand Down
55 changes: 14 additions & 41 deletions dist/js/jquery.atwho.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,18 +685,8 @@ EditableController = (function(superClass) {
return e.type === 'click' || ((ref = e.which) === KEY_CODE.RIGHT || ref === KEY_CODE.LEFT || ref === KEY_CODE.UP || ref === KEY_CODE.DOWN);
};

EditableController.prototype._unwrap = function(node) {
var next;
node = $(node).unwrap().get(0);
if ((next = node.nextSibling) && next.nodeValue) {
node.nodeValue += next.nodeValue;
$(next).remove();
}
return node;
};

EditableController.prototype.catchQuery = function(e) {
var $inserted, $query, _range, index, inserted, isString, lastNode, matched, offset, query, query_content, range;
var $inserted, $query, _range, index, inserted, isString, lastNode, matched, offset, parentNode, query, query_content, range;
if (!(range = this._getRange())) {
return;
}
Expand Down Expand Up @@ -790,7 +780,9 @@ EditableController = (function(superClass) {
if (this._movingEvent(e) && $query.hasClass('atwho-inserted')) {
$query.removeClass('atwho-query');
} else if (false !== this.callbacks('afterMatchFailed').call(this, this.at, $query)) {
this._setRange("after", this._unwrap($query.text($query.text()).contents().first()));
parentNode = $query[0].parentNode;
this._setRange("after", $query.text($query.text()).contents().first().unwrap());
parentNode.normalize();
}
}
return null;
Expand Down Expand Up @@ -902,19 +894,14 @@ View = (function() {
function View(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
this.context.$el.append(this.$el);
this.bindEvent();
}

View.prototype.init = function() {
var header_tpl, id;
var id;
id = this.context.getOpt("alias") || this.context.at.charCodeAt(0);
header_tpl = this.context.getOpt("headerTpl");
if (header_tpl && this.$el.children().length === 1) {
this.$el.prepend(header_tpl);
}
return this.$el.attr({
'id': "at-view-" + id
});
Expand All @@ -925,26 +912,12 @@ View = (function() {
};

View.prototype.bindEvent = function() {
var $menu, lastCoordX, lastCoordY;
var $menu;
$menu = this.$el.find('ul');
lastCoordX = 0;
lastCoordY = 0;
return $menu.on('mousemove.atwho-view', 'li', (function(_this) {
return function(e) {
var $cur;
if (lastCoordX === e.clientX && lastCoordY === e.clientY) {
return;
}
lastCoordX = e.clientX;
lastCoordY = e.clientY;
$cur = $(e.currentTarget);
if ($cur.hasClass('cur')) {
return;
}
$menu.find('.cur').removeClass('cur');
return $cur.addClass('cur');
};
})(this)).on('click.atwho-view', 'li', (function(_this) {
return $menu.on('mouseenter.atwho-view', 'li', function(e) {
$menu.find('.cur').removeClass('cur');
return $(e.currentTarget).addClass('cur');
}).on('click.atwho-view', 'li', (function(_this) {
return function(e) {
$menu.find('.cur').removeClass('cur');
$(e.currentTarget).addClass('cur');
Expand Down Expand Up @@ -1004,7 +977,7 @@ View = (function() {
next = this.$el.find('li:first');
}
next.addClass('cur');
return this.scrollTop(Math.max(0, cur.outerHeight(true) * (next.index() + 2) - this.$el.height()));
return this.scrollTop(Math.max(0, cur.innerHeight() * (next.index() + 2) - this.$el.height()));
};

View.prototype.prev = function() {
Expand All @@ -1015,18 +988,18 @@ View = (function() {
prev = this.$el.find('li:last');
}
prev.addClass('cur');
return this.scrollTop(Math.max(0, cur.outerHeight(true) * (prev.index() + 2) - this.$el.height()));
return this.scrollTop(Math.max(0, cur.innerHeight() * (prev.index() + 2) - this.$el.height()));
};

View.prototype.scrollTop = function(scrollTop) {
var scrollDuration;
scrollDuration = this.context.getOpt('scrollDuration');
if (scrollDuration) {
return this.$elUl.animate({
return this.$el.animate({
scrollTop: scrollTop
}, scrollDuration);
} else {
return this.$elUl.scrollTop(scrollTop);
return this.$el.scrollTop(scrollTop);
}
};

Expand Down
Loading

0 comments on commit d3d17b5

Please sign in to comment.