今天研究prototype winodw源码,看到源码中有一个全局变量 Windows,这个可以对每个window进行管理,也可以对所有window进行管理。 其中有两个方法close,closeAll,就想到再加两个show,showAll,代码如下: show: function(id, event) { var win = this.getWindow(id); if (win) win.show(); if (event) Event.start(event); }, showAll: function(){ this.windows.each( function(w) {Windows.show(w.getId())} ); }, 试了一下,可以正常工作。

评论