Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to 1.5.4 #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-atwho-rails",
"version": "1.5.2",
"version": "1.5.4",
"homepage": "https://github.com/ichord/jquery-atwho-rails",
"authors": [
"ichord <[email protected]>"
Expand All @@ -14,6 +14,6 @@
"tests"
],
"dependencies": {
"At.js": "~1.5.2"
"At.js": "~1.5.4"
}
}
47 changes: 23 additions & 24 deletions lib/assets/javascripts/jquery.atwho/jquery.atwho.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* at.js - 1.5.2
* Copyright (c) 2016 chord.luo <[email protected]>;
* at.js - 1.5.4
* Copyright (c) 2017 chord.luo <[email protected]>;
* Homepage: http://ichord.github.com/At.js
* License: MIT
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ DEFAULT_CALLBACKS = {
});
},
tplEval: function(tpl, map) {
var error, template;
var error, error1, template;
template = tpl;
try {
if (typeof tpl !== 'string') {
Expand Down Expand Up @@ -142,7 +142,7 @@ App = (function() {
};

App.prototype.setupRootElement = function(iframe, asRoot) {
var error;
var error, error1;
if (asRoot == null) {
asRoot = false;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ Controller = (function() {
};

Controller.prototype.callDefault = function() {
var args, error, funcName;
var args, error, error1, funcName;
funcName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
try {
return DEFAULT_CALLBACKS[funcName].apply(this, args);
Expand All @@ -434,7 +434,7 @@ Controller = (function() {
};

Controller.prototype.getOpt = function(at, default_value) {
var e;
var e, error1;
try {
return this.setting[at];
} catch (error1) {
Expand Down Expand Up @@ -809,7 +809,7 @@ EditableController = (function(superClass) {
EditableController.prototype.rect = function() {
var $iframe, iframeOffset, rect;
rect = this.query.el.offset();
if (!rect) {
if (!(rect && this.query.el[0].getClientRects().length)) {
return;
}
if (this.app.iframe && !this.app.iframeAsRoot) {
Expand All @@ -826,26 +826,25 @@ EditableController = (function(superClass) {
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
overrides = this.getOpt("functionOverrides");
overrides = this.getOpt('functionOverrides');
if (overrides.insert) {
return overrides.insert.bind(this)(content, $li);
} else {
suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || "\u00A0";
data = $li.data('item-data');
this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(content).attr('data-atwho-at-query', "" + data['atwho-at'] + this.query.text).attr('contenteditable', "false");
if (range = this._getRange()) {
if (this.query.el.length) {
range.setEndAfter(this.query.el[0]);
}
range.collapse(false);
range.insertNode(suffixNode = this.app.document.createTextNode("\u200D" + suffix));
this._setRange('after', suffixNode, range);
}
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
return overrides.insert.call(this, content, $li);
}
suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || "\u00A0";
data = $li.data('item-data');
this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(content).attr('data-atwho-at-query', "" + data['atwho-at'] + this.query.text).attr('contenteditable', "false");
if (range = this._getRange()) {
if (this.query.el.length) {
range.setEndAfter(this.query.el[0]);
}
return this.$inputor.change();
range.collapse(false);
range.insertNode(suffixNode = this.app.document.createTextNode("" + suffix));
this._setRange('after', suffixNode, range);
}
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
return this.$inputor.change();
};

return EditableController;
Expand Down
2 changes: 1 addition & 1 deletion lib/jquery-atwho-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Jquery
module Atwho
module Rails
VERSION = '1.5.2'
VERSION = '1.5.4'
end
end
end