]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/_base/popup.js.uncompressed.js
1 define("dijit/_base/popup", [
2 "dojo/dom-class", // domClass.contains
5 "../BackgroundIframe" // just loading for back-compat, in case client code is referencing it
6 ], function(domClass
, win
, popup
){
14 // Deprecated. Old module for popups, new code should use dijit/popup directly.
19 // Hack support for old API passing in node instead of a widget (to various methods)
20 var origCreateWrapper
= popup
._createWrapper
;
21 popup
._createWrapper = function(widget
){
22 if(!widget
.declaredClass
){
23 // make fake widget to pass to new API
25 _popupWrapper
: (widget
.parentNode
&& domClass
.contains(widget
.parentNode
, "dijitPopup")) ?
26 widget
.parentNode
: null,
28 destroy: function(){},
29 ownerDocument
: widget
.ownerDocument
,
30 ownerDocumentBody
: win
.body(widget
.ownerDocument
)
33 return origCreateWrapper
.call(this, widget
);
36 // Support old format of orient parameter
37 var origOpen
= popup
.open
;
38 popup
.open = function(/*__OpenArgs*/ args
){
39 // Convert old hash structure (ex: {"BL": "TL", ...}) of orient to format compatible w/new popup.open() API.
40 // Don't do conversion for:
41 // - null parameter (that means to use the default positioning)
42 // - "R" or "L" strings used to indicate positioning for context menus (when there is no around node)
43 // - new format, ex: ["below", "above"]
44 // - return value from deprecated dijit.getPopupAroundAlignment() method,
45 // ex: ["below", "above"]
46 if(args
.orient
&& typeof args
.orient
!= "string" && !("length" in args
.orient
)){
48 for(var key
in args
.orient
){
49 ary
.push({aroundCorner
: key
, corner
: args
.orient
[key
]});
54 return origOpen
.call(this, args
);