feature(util) rm forEach

This commit is contained in:
coderaiser 2014-12-15 04:31:48 -05:00
parent 083817692a
commit 7dfcd38a05
5 changed files with 5 additions and 19 deletions

View file

@ -128,7 +128,7 @@ var CloudCmd, Util, DOM, io;
};
}
Util.forEach(inputs, function(input) {
[].forEach.call(inputs, function(input) {
Events.addKey(input, onKey)
.add('change', input, function(event) {
onChange(event.target);

View file

@ -448,7 +448,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (files.length) {
func = func(files[0].name);
Util.forEach(files, function(file) {
[].forEach.call(files, function(file) {
func = Util.exec.with(load, file, func);
});

View file

@ -644,7 +644,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
files = event.dataTransfer.files;
Util.forEach(files, function(file) {
[].forEach.call(files, function(file) {
reader = new FileReader();
Events.addLoad(reader, onLoad);
reader.readAsBinaryString(file);

View file

@ -266,7 +266,7 @@ var Util, DOM, CloudFunc, CloudCmd;
event.preventDefault();
},
toggle = function () {
Util.forEach(panels, function(panel) {
[].forEach.call(panels, function(panel) {
DOM.toggleClass(panel, 'selected-panel');
});
},
@ -279,7 +279,7 @@ var Util, DOM, CloudFunc, CloudCmd;
Events.add(['dragenter', 'dragleave', 'drop'], toggle);
Util.forEach(panels, function(panel) {
[].forEach.call(panels, function(panel) {
Events.add('dragover', panel, preventDefault)
.add('drop', panel, onDrop);
});

View file

@ -444,20 +444,6 @@
return ret;
};
/**
* function calls forEach for all array like variables
*
* @param array
*/
this.forEach = function(array, callback) {
var ret = [];
if (array)
ret = [].forEach.call(array, callback);
return ret;
};
this.exec = new ExecProto();
function ExecProto() {