mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -31,7 +31,7 @@ print_r($x);
|
||||
console.log(true, msg);
|
||||
return;
|
||||
}
|
||||
console.error(msg, value, need);
|
||||
console.error(msg, '-', 'value:', value, 'need:', need);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -213,7 +213,14 @@ kit.ready(['collection'], function () {
|
||||
assertSame(x3.last(), 111, 'only last+');
|
||||
assertSame(x3.length, 1, 'only length');
|
||||
|
||||
x.
|
||||
|
||||
xOb = {a: 'a10', b: 'b11', 10: 101};
|
||||
x = new kit.Collection(xOb);
|
||||
x.set(11, 111);
|
||||
assertSame(x.indexKey(11), 3, 'indexKey (int)');
|
||||
assertSame(x.indexKey('11'), 3, 'indexKey (string)');
|
||||
assertSame(x.indexKey('111'), -1, 'indexKey (-1)');
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
+17
-9
@@ -140,7 +140,7 @@ kit.ready(['menu', 'animations'], function () {
|
||||
var menu;
|
||||
menu = kit.menu.getInstance({
|
||||
alignOffset: [0, 5],
|
||||
eventType: 'click',
|
||||
eventType: 'popover',
|
||||
}, [
|
||||
{
|
||||
label: 'еще (' + window.i + ')',
|
||||
@@ -161,19 +161,20 @@ kit.ready(['menu', 'animations'], function () {
|
||||
|
||||
window.menuBuilder = (function(){
|
||||
console.log('menuBuilder');
|
||||
window.menuBase = null;
|
||||
|
||||
var menuBase = new kit.menu.Class();
|
||||
window.menuBase = menuBase;
|
||||
|
||||
menuBase.setOptions({
|
||||
animation: kit.animations.scaleIn,
|
||||
alignOffset: [5, 5],
|
||||
hideDelay: 1000,
|
||||
parent: '#chat-message-15 .chat-message--manager-item-menu',
|
||||
/**
|
||||
* доступно 2 режима click / hover,
|
||||
* доступно 2 режима popover / hint,
|
||||
* понимать так: данное меню появляется по Клику на родитя (по дефолту hover)
|
||||
*/
|
||||
eventType: 'click',
|
||||
eventType: 'popover',
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -249,7 +250,7 @@ kit.ready(['menu', 'animations'], function () {
|
||||
menuItem.remove();
|
||||
},
|
||||
});
|
||||
menu.reInit();
|
||||
menu.init();
|
||||
},
|
||||
});
|
||||
/**
|
||||
@@ -262,16 +263,23 @@ kit.ready(['menu', 'animations'], function () {
|
||||
var item1 = menuBase.addItem({
|
||||
|
||||
label: 'меняем предка на R',
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
* @param menuItem
|
||||
* @param {kit.menu.Class} menu
|
||||
*/
|
||||
click: function(e, menuItem, menu) {
|
||||
console.log('клик by ' + menuItem.options.label);
|
||||
menuItem.setVisible(false);
|
||||
var tMenu = menu.getItemById(item2.getId());
|
||||
|
||||
if(tMenu) {
|
||||
tMenu.setVisible(true);
|
||||
}
|
||||
menu.setParent(document.querySelector('#change-context-menu-r'));
|
||||
menu.setParent('#change-context-menu-r');
|
||||
},
|
||||
}, true);
|
||||
});
|
||||
var item2 = menuBase.addItem({
|
||||
label: 'меняем предка на X',
|
||||
visible: false,
|
||||
@@ -282,9 +290,9 @@ kit.ready(['menu', 'animations'], function () {
|
||||
if(tMenu) {
|
||||
tMenu.setVisible(true);
|
||||
}
|
||||
menu.setParent(document.querySelector('#change-context-menu-x'));
|
||||
menu.setParent('#change-context-menu-x');
|
||||
},
|
||||
}, true);
|
||||
});
|
||||
|
||||
menuBase.init();
|
||||
|
||||
|
||||
@@ -33,11 +33,24 @@ $APPLICATION->ShowHead();
|
||||
m5.viewer.animShowClass = kit.animations.scaleIn;
|
||||
m5.viewer.animHideClass = kit.animations.scaleOut;
|
||||
m5.run();
|
||||
// var m6 = new kit.userAction.Hint();
|
||||
var m6 = new kit.userAction.Hint('#object8', '#object9');
|
||||
m6.run();
|
||||
m6.viewer.animShowClass = kit.animations.scaleIn;
|
||||
m6.viewer.animHideClass = kit.animations.scaleOut;
|
||||
m6.run();
|
||||
|
||||
var m7 = new kit.userAction.Hint();
|
||||
try {
|
||||
m7.run();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
try {
|
||||
m7.stop();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user