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