diff options
author | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
commit | 7c97d17aaf373339a8bcd917ad59ca6018148f0d (patch) | |
tree | 5a3c04f0f9529be392c1263d3feb75806eb43797 /lib/dijit/_base/popup.js.uncompressed.js | |
parent | 70db7424e7068701e60cc5bcdfe8f858be508179 (diff) | |
parent | c670a80ddd9b03bd4ea6d940a9ed682fd26248d7 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lib/dijit/_base/popup.js.uncompressed.js')
-rw-r--r-- | lib/dijit/_base/popup.js.uncompressed.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/dijit/_base/popup.js.uncompressed.js b/lib/dijit/_base/popup.js.uncompressed.js new file mode 100644 index 000000000..cc582e66e --- /dev/null +++ b/lib/dijit/_base/popup.js.uncompressed.js @@ -0,0 +1,58 @@ +define("dijit/_base/popup", [ + "dojo/dom-class", // domClass.contains + "dojo/_base/window", + "../popup", + "../BackgroundIframe" // just loading for back-compat, in case client code is referencing it +], function(domClass, win, popup){ + +// module: +// dijit/_base/popup + +/*===== +return { + // summary: + // Deprecated. Old module for popups, new code should use dijit/popup directly. +}; +=====*/ + + +// Hack support for old API passing in node instead of a widget (to various methods) +var origCreateWrapper = popup._createWrapper; +popup._createWrapper = function(widget){ + if(!widget.declaredClass){ + // make fake widget to pass to new API + widget = { + _popupWrapper: (widget.parentNode && domClass.contains(widget.parentNode, "dijitPopup")) ? + widget.parentNode : null, + domNode: widget, + destroy: function(){}, + ownerDocument: widget.ownerDocument, + ownerDocumentBody: win.body(widget.ownerDocument) + }; + } + return origCreateWrapper.call(this, widget); +}; + +// Support old format of orient parameter +var origOpen = popup.open; +popup.open = function(/*__OpenArgs*/ args){ + // Convert old hash structure (ex: {"BL": "TL", ...}) of orient to format compatible w/new popup.open() API. + // Don't do conversion for: + // - null parameter (that means to use the default positioning) + // - "R" or "L" strings used to indicate positioning for context menus (when there is no around node) + // - new format, ex: ["below", "above"] + // - return value from deprecated dijit.getPopupAroundAlignment() method, + // ex: ["below", "above"] + if(args.orient && typeof args.orient != "string" && !("length" in args.orient)){ + var ary = []; + for(var key in args.orient){ + ary.push({aroundCorner: key, corner: args.orient[key]}); + } + args.orient = ary; + } + + return origOpen.call(this, args); +}; + +return popup; +}); |