[置顶] 我修正的 modalbox 的一个bug

来源:互联网 发布:c语言 double 编辑:程序博客网 时间:2024/06/02 22:10
http://code.google.com/p/modalbox/issues/detail?id=360 写道

 

http://code.google.com/p/modalbox/

 

1. this.focusableElements is undefined modalbox.js Line 438<code>_putContent: function(callback){this.MBcontent.show();this.focusableElements = this._findFocusableElements();this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button)if(callback != undefined)callback(); // Executing internal JS from loaded contentthis.event("afterLoad"); // Passing callback},</code>this.focusableElements = this._findFocusableElements(); have a problem<code>_findFocusableElements: function() { // Collect form elements or links from MB contentif (this.options.autoFocusing === true) {// TODO maybe add :enabled to select and textarea elementsthis.MBcontent.select('input:not([type=hidden]):enabled, select, textarea, button, a[href]').invoke('addClassName', 'MB_focusable');this.focusableElements = this.MBcontent.select('.MB_focusable');}},<code>if this.options.autoFocusing == false , will not return valueI add line "return this.focusableElements ;" or modify _putContent function line: this.focusableElements = this._findFocusableElements();modify this._findFocusableElements();
0 0