]> git.wh0rd.org Git - tt-rss.git/blob - lib/dijit/form/_FormValueWidget.js.uncompressed.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dijit / form / _FormValueWidget.js.uncompressed.js
1 define("dijit/form/_FormValueWidget", [
2         "dojo/_base/declare", // declare
3         "dojo/sniff", // has("ie")
4         "./_FormWidget",
5         "./_FormValueMixin"
6 ], function(declare, has, _FormWidget, _FormValueMixin){
7
8 // module:
9 //              dijit/form/_FormValueWidget
10
11 return declare("dijit.form._FormValueWidget", [_FormWidget, _FormValueMixin],
12 {
13         // summary:
14         //              Base class for widgets corresponding to native HTML elements such as `<input>` or `<select>`
15         //              that have user changeable values.
16         // description:
17         //              Each _FormValueWidget represents a single input value, and has a (possibly hidden) `<input>` element,
18         //              to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
19         //              works as expected.
20
21         // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
22         // directly in the template as read by the parser in order to function. IE is known to specifically
23         // require the 'name' attribute at element creation time.  See #8484, #8660.
24
25         _layoutHackIE7: function(){
26                 // summary:
27                 //              Work around table sizing bugs on IE7 by forcing redraw
28
29                 if(has("ie") == 7){ // fix IE7 layout bug when the widget is scrolled out of sight
30                         var domNode = this.domNode;
31                         var parent = domNode.parentNode;
32                         var pingNode = domNode.firstChild || domNode; // target node most unlikely to have a custom filter
33                         var origFilter = pingNode.style.filter; // save custom filter, most likely nothing
34                         var _this = this;
35                         while(parent && parent.clientHeight == 0){ // search for parents that haven't rendered yet
36                                 (function ping(){
37                                         var disconnectHandle = _this.connect(parent, "onscroll",
38                                                 function(){
39                                                         _this.disconnect(disconnectHandle); // only call once
40                                                         pingNode.style.filter = (new Date()).getMilliseconds(); // set to anything that's unique
41                                                         _this.defer(function(){ pingNode.style.filter = origFilter; }); // restore custom filter, if any
42                                                 }
43                                         );
44                                 })();
45                                 parent = parent.parentNode;
46                         }
47                 }
48         }
49 });
50
51 });