There was an error while loading. Please reload this page.
1 parent a9cfbd6 commit 9134d70Copy full SHA for 9134d70
1 file changed
src/Util.js
@@ -53,7 +53,7 @@ html2canvas.prototype.getBounds = function(el){
53
html2canvas.prototype.each = function(arrayLoop,callbackFunc){
54
callbackFunc = callbackFunc || function(){};
55
for (var i=0;i<arrayLoop.length;i++){
56
- callbackFunc(i,arrayLoop[i]);
+ if (callbackFunc(i,arrayLoop[i]) === false) return;
57
}
58
59
@@ -149,4 +149,18 @@ html2canvas.prototype.getContents = function(el){
149
*/
150
html2canvas.prototype.getCSS = function(el,attribute){
151
return $(el).css(attribute);
152
+}
153
+
154
155
+html2canvas.prototype.getIndex = function(array,src){
156
157
+ if (array.indexOf){
158
+ return array.indexOf(src);
159
+ }else{
160
+ for(var i = 0; i < array.length; i++){
161
+ if(this[i] == src) return i;
162
+ }
163
+ return -1;
164
165
166
0 commit comments