1
1
/**
2
- * at.js - 1.5.1
3
- * Copyright (c) 2016 chord.luo <chord.luo@gmail.com>;
2
+ * at.js - 1.5.3
3
+ * Copyright (c) 2017 chord.luo <chord.luo@gmail.com>;
4
4
* Homepage: http://ichord.github.com/At.js
5
5
* License: MIT
6
6
*/
@@ -88,7 +88,7 @@ DEFAULT_CALLBACKS = {
88
88
} ) ;
89
89
} ,
90
90
tplEval : function ( tpl , map ) {
91
- var error , template ;
91
+ var error , error1 , template ;
92
92
template = tpl ;
93
93
try {
94
94
if ( typeof tpl !== 'string' ) {
@@ -142,7 +142,7 @@ App = (function() {
142
142
} ;
143
143
144
144
App . prototype . setupRootElement = function ( iframe , asRoot ) {
145
- var error ;
145
+ var error , error1 ;
146
146
if ( asRoot == null ) {
147
147
asRoot = false ;
148
148
}
@@ -408,7 +408,7 @@ Controller = (function() {
408
408
} ;
409
409
410
410
Controller . prototype . callDefault = function ( ) {
411
- var args , error , funcName ;
411
+ var args , error , error1 , funcName ;
412
412
funcName = arguments [ 0 ] , args = 2 <= arguments . length ? slice . call ( arguments , 1 ) : [ ] ;
413
413
try {
414
414
return DEFAULT_CALLBACKS [ funcName ] . apply ( this , args ) ;
@@ -434,7 +434,7 @@ Controller = (function() {
434
434
} ;
435
435
436
436
Controller . prototype . getOpt = function ( at , default_value ) {
437
- var e ;
437
+ var e , error1 ;
438
438
try {
439
439
return this . setting [ at ] ;
440
440
} catch ( error1 ) {
@@ -822,30 +822,25 @@ EditableController = (function(superClass) {
822
822
} ;
823
823
824
824
EditableController . prototype . insert = function ( content , $li ) {
825
- var data , overrides , range , suffix , suffixNode ;
825
+ var data , range , suffix , suffixNode ;
826
826
if ( ! this . $inputor . is ( ':focus' ) ) {
827
827
this . $inputor . focus ( ) ;
828
828
}
829
- overrides = this . getOpt ( "functionOverrides" ) ;
830
- if ( overrides . insert ) {
831
- return overrides . insert . bind ( this ) ( content , $li ) ;
832
- } else {
833
- suffix = ( suffix = this . getOpt ( 'suffix' ) ) === "" ? suffix : suffix || "\u00A0" ;
834
- data = $li . data ( 'item-data' ) ;
835
- 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" ) ;
836
- if ( range = this . _getRange ( ) ) {
837
- if ( this . query . el . length ) {
838
- range . setEndAfter ( this . query . el [ 0 ] ) ;
839
- }
840
- range . collapse ( false ) ;
841
- range . insertNode ( suffixNode = this . app . document . createTextNode ( "\u200D" + suffix ) ) ;
842
- this . _setRange ( 'after' , suffixNode , range ) ;
843
- }
844
- if ( ! this . $inputor . is ( ':focus' ) ) {
845
- this . $inputor . focus ( ) ;
829
+ suffix = ( suffix = this . getOpt ( 'suffix' ) ) === "" ? suffix : suffix || "\u00A0" ;
830
+ data = $li . data ( 'item-data' ) ;
831
+ 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" ) ;
832
+ if ( range = this . _getRange ( ) ) {
833
+ if ( this . query . el . length ) {
834
+ range . setEndAfter ( this . query . el [ 0 ] ) ;
846
835
}
847
- return this . $inputor . change ( ) ;
836
+ range . collapse ( false ) ;
837
+ range . insertNode ( suffixNode = this . app . document . createTextNode ( "" + suffix ) ) ;
838
+ this . _setRange ( 'after' , suffixNode , range ) ;
839
+ }
840
+ if ( ! this . $inputor . is ( ':focus' ) ) {
841
+ this . $inputor . focus ( ) ;
848
842
}
843
+ return this . $inputor . change ( ) ;
849
844
} ;
850
845
851
846
return EditableController ;
@@ -1188,7 +1183,6 @@ $.fn.atwho["default"] = {
1188
1183
insertTpl : "${atwho-at}${name}" ,
1189
1184
headerTpl : null ,
1190
1185
callbacks : DEFAULT_CALLBACKS ,
1191
- functionOverrides : { } ,
1192
1186
searchKey : "name" ,
1193
1187
suffix : void 0 ,
1194
1188
hideWithoutSuffix : false ,
0 commit comments