Skip to content

Instantly share code, notes, and snippets.

View a-ignatov-parc's full-sized avatar

Anton Ignatov a-ignatov-parc

View GitHub Profile
<input type="checkbox" class="js-filter_control js-filter_control-name_test" name="test" />
asyncTest('Context works normaly between to instances of one class', 1, function() {
var observatory = new window.WebApp.Observatory(),
TestClass = function() {
var count = this.count,
cid;
this.cid = cid = 'c' + count;
this.constructor.prototype.count++
this.init = function() {
asyncTest('bind two events with name "test.a1" and "test.a2" then unbind "test" trigger "test"', 1, function() {
var observatory = new window.WebApp.Observatory();
observatory.on('test', function() {
equal(this.a, 1, 'context is ok');
}, {
a: 1
});
start();
var $item = $(item),
tip = $item.data('popover').tip();
if ($.contains(event.currentTarget.body, tip[0]) && !$.contains(tip[0], event.target)) {
$item.popover('hide');
}
maskedElement.inputmask({
autoUnmask: NO,
mask: '' + mask,
clearIncomplete: YES,
placeholder: placeholder,
clearMaskOnLostFocus: NO
});
handlebars: {
compile: {
options: {
node: true,
wrapped: true,
namespace: 'App.Templates',
processName: function(pathname) {
var filename = pathname
.split('/')
.pop()
this.core
.unload()
.renderStream(['Header', 'PageControls', 'Panel', {
name: 'Filter',
params: {
buttons: [{
Style: 'grey',
Position: 'full',
Action: 'create_template',
Text: 'Создать шаблон'
#!/bin/sh
echo "\nStarting Grunt tests"
# Lint catalog js files with grunt.js
grunt catalog
RETVAL=$?
[ $RETVAL -eq 0 ] && echo Success
[ $RETVAL -ne 0 ] && echo Failure
// Инициализируем попапы для всех элементов что попадают под селектор и получаем конструктор
// поповера
var popoverConstructor = $(selector).popover({
html: true,
container: '.b-container',
template: 'some template...',
content: function() {
// Обрабатываем контент и возвращаем
return content;
},
function transition(env, step, callback) {
if (typeof(callback) !== 'function') {
callback = function() {};
}
// Effect
switch (env.params.effect){
// No effect
case "no":