This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The main rule: I want to see a method call. Brackets are the most simple way to make it. | |
# if there is single argument and it is not a string, brackets required | |
fn() | |
fn(1) | |
fn(variable) | |
# if just single string, quotes are some kind of brackets here, and brackets can be omitted | |
fn 'string' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suggest = target | |
.autocomplete({ | |
... | |
}) // Инициализируем у инпута автокомплит с набором параметров | |
.data('autocompleter'); // Сохраняем в переменную suggest объект автокомплита сохраненный в data атрибуте autocompleter за счет чейнинга | |
// Изменяем поведение метода position на нужное | |
suggest.position = function() { | |
var offset = this.dom.$elem.offset(); | |
this.dom.$results.css({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.extend($.Autocompleter.prototype, { | |
position: function() { | |
var offset = this.dom.$elem.offset(); | |
this.dom.$results.css({ | |
bottom: Plca.view.partials.$body.height() - offset.top, | |
left: offset.left | |
}); | |
}, | |
cloneFunc: function(func) { | |
var temp = function() { |