feature(util) bind -> exec.with

This commit is contained in:
coderaiser 2014-05-23 07:55:24 -04:00
parent ec9a78a27a
commit 6b58016616
16 changed files with 61 additions and 60 deletions

View file

@ -35,7 +35,7 @@ var CloudCmd, Util, DOM;
this.show = function() {
var funcs = [
Util.bind(CloudCmd.getTemplate, Template, 'config'),
Util.exec.with(CloudCmd.getTemplate, Template, 'config'),
cssLoad
];

View file

@ -13,8 +13,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
Loading,
jqconsole,
log = Util.bind(write, 'log'),
error = Util.bind(write, 'error'),
log = Util.exec.with(write, 'log'),
error = Util.exec.with(write, 'error'),
Element,
MouseBinded,

View file

@ -59,7 +59,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
not_append : true
});
onMenu = Util.bind(setMenu, Element);
onMenu = Util.exec.with(setMenu, Element);
initAce();
@ -272,7 +272,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
});
});
}, Util.bind(doDiff, path));
}, Util.exec.with(doDiff, path));
});
}

View file

@ -12,12 +12,12 @@ var Util, DOM, CloudCmd;
getConfig = CloudCmd.getConfig,
OnPathLinks = [],
EventsFiles = {
'mousedown' : Util.bind(execIfNotUL, setCurrentFileByEvent),
'mousedown' : Util.exec.with(execIfNotUL, setCurrentFileByEvent),
'contextmenu' : onContextMenu,
'dragstart' : Util.bind(execIfNotUL, onDragStart),
'dragstart' : Util.exec.with(execIfNotUL, onDragStart),
'click' : onClick,
'dblclick' : Util.bind(execIfNotUL, onDblClick),
'touchstart' : Util.bind(execIfNotUL, onTouch)
'dblclick' : Util.exec.with(execIfNotUL, onDblClick),
'touchstart' : Util.exec.with(execIfNotUL, onTouch)
};
this.analytics = function() {
@ -101,7 +101,7 @@ var Util, DOM, CloudCmd;
for (i = 0; i < n; i++) {
ai = pathLinks[i];
link = Util.rmStr(ai.href, url),
load = Util.bind(loadDir, {
load = Util.exec.with(loadDir, {
path : link,
isRefresh : false,
panel : panel
@ -359,7 +359,7 @@ var Util, DOM, CloudCmd;
if (files.length) {
Util.forEach(files, function(file) {
func = Util.bind(load, file, func);
func = Util.exec.with(load, file, func);
});
func();

View file

@ -17,7 +17,7 @@ var CloudCmd, Util, DOM;
Util.exec.series([
CloudCmd.View,
Util.bind(MD.show, null, null),
Util.exec.with(MD.show, null, null),
]);
}

View file

@ -86,7 +86,7 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
options = {
icon : true,
beforeClose : Key.setBind,
beforeShow : Util.bind(beforeShow, func),
beforeShow : Util.exec.with(beforeShow, func),
beforeClick : beforeClick,
name : name
};
@ -114,8 +114,8 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
},
menuData = getMenuData(),
menu = {
'View' : Util.bind(show, 'View'),
'Edit' : Util.bind(show, 'Edit'),
'View' : Util.exec.with(show, 'View'),
'Edit' : Util.exec.with(show, 'Edit'),
'Rename' : function() {
setTimeout(DOM.renameCurrent, 100);
},
@ -169,7 +169,7 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
items = Util.getNamesFromObjArray(storage) || [];
items.forEach(function(name) {
menu[name] = Util.bind(uploadTo, name);
menu[name] = Util.exec.with(uploadTo, name);
});
callback(menu);

View file

@ -48,7 +48,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
View.hide = hide;
function init() {
var func = CallBack || Util.bind(show, null);
var func = CallBack || Util.exec.with(show, null);
Loading = true;
@ -64,7 +64,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
className : 'view-overlay fancybox-overlay fancybox-overlay-fixed'
});
Events.addClick(Util.bind(onOverLayClick, Overlay), Overlay);
Events.addClick(Util.exec.with(onOverLayClick, Overlay), Overlay);
Events.addKey(listener);
}
@ -92,7 +92,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
if (isFunc) {
func = config[name];
config[name] = Util.bind(execParallel, [item, func]);
config[name] = Util.exec.with(execParallel, [item, func]);
} else {
config[name] = options[name];
}
@ -127,7 +127,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
case 'media':
getMediaElement(path, function(element) {
var media = DOM.getByDataName('js-media', element),
onKey = Util.bind(onMediaKey, media);
onKey = Util.exec.with(onMediaKey, media);
$.fancybox.open(element, {
parent : Overlay,