当前位置: 首页 > 工具软件 > ModalBox > 使用案例 >

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

居京
2023-12-01
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 content
		this.event("afterLoad"); // Passing callback
	},
</code>
this.focusableElements = this._findFocusableElements(); have a problem

<code>
_findFocusableElements: function() { // Collect form elements or links from MB content
		if (this.options.autoFocusing === true) {
			// TODO maybe add :enabled to select and textarea elements
			this.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 value
I add line "return this.focusableElements ;" or modify _putContent function line: 

this.focusableElements = this._findFocusableElements();
modify 
this._findFocusableElements();
 类似资料: