123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- if (typeof window.RadControlsNamespace == "undefined")
- {
- window.RadControlsNamespace = {};
- }
- if (
- typeof(window.RadControlsNamespace.Ease) == "undefined" ||
- typeof(window.RadControlsNamespace.Ease.Version) == null ||
- window.RadControlsNamespace.Ease.Version < 1.3
- )
- {
- RadControlsNamespace.Ease = function (element, configObject, offsetX, offsetY, listener, createOverlay)
- {
-
- this.Element = element;
- if (createOverlay)
- {
- this.Overlay = new RadControlsNamespace.Overlay(element);
- }
-
-
- this.OffsetX = offsetX;
- this.OffsetY = offsetY;
-
- this.Invert = false;
- var parent = this.Element.parentNode;
-
- this.ExpandConfig = this.MergeConfig(configObject.ExpandAnimation);
- this.CollapseConfig = this.MergeConfig(configObject.CollapseAnimation);
-
- this.Ticker = new RadControlsNamespace.Ticker(this);
- this.Listener = listener;
- this.SlideParent = false;
-
- }
- RadControlsNamespace.Ease.Version = 1.3;// update in the header IF also
- RadControlsNamespace.Ease.Coef = 0;
- RadControlsNamespace.Ease.prototype =
- {
- SetSide : function(side)
- {
- this.InitialSide = side.charAt(0).toUpperCase() + side.substr(1, side.length - 1);
- this.Invert = false;
- if (side == 'right')
- {
- side = 'left';
- this.Invert = true;
- }
- if (side == 'bottom')
- {
- side = 'top';
- this.Invert = true;
- }
- this.Side = side;
- this.Horizontal = side == "left";
- },
-
- MergeConfig : function (config)
- {
- if (!config.Type)
- {
- config.Type = "OutQuint";
- }
-
- if (!config.Duration)
- {
- config.Duration = 200;
- }
-
- return config;
- },
-
-
- GetSide : function ()
- {
- return this.InitialSide;
- },
-
- ShowElements : function ()
- {
- if (!this.Element.parentNode) return;
- if (!this.Element.parentNode.style) return;
-
- this.Element.parentNode.style.display = "block";
- this.Element.style.display = "block";
- this.Element.parentNode.style.overflow = "hidden";
- },
-
- Dispose : function ()
- {
- this.Ticker.Stop();
- this.Element = null;
- if (this.Overlay)
- {
- this.Overlay.Dispose();
- }
- },
-
- ResetState : function (resetPosition)
- {
- this.ShowElements();
- if (resetPosition)
- {
- var initialPosition = (this.Horizontal ? this.Element.offsetWidth : this.Element.offsetHeight);
- if (!this.Invert)
- {
- initialPosition = -initialPosition;
- }
- this.SetPosition(initialPosition);
- }
- this.InitialPosition = this.GetPosition();
- },
- UpdateContainerSize : function ()
- {
- if (!this.Element.parentNode)
- {
- //r.a.d.callback
- return;
- }
-
- if (!this.Element.offsetWidth || !this.Element.offsetHeight )
- {
- return;
- }
-
- if (this.Invert)
- {
- if (this.Side == "left")
- {
- this.Element.parentNode.style.height = this.Element.offsetHeight + "px";
- }
- else if (this.Side == "top")
- {
- this.Element.parentNode.style.width = this.Element.offsetWidth + "px";
- }
-
- return;
- }
- var top = 0;
- var left = 0;
-
- if (this.Element.style.top != "")
- {
- top = Math.max(parseInt(this.Element.style.top), 0);
- }
-
- if (this.Element.style.left != "")
- {
- left = Math.max(parseInt(this.Element.style.left), 0);
- }
-
-
- if (this.SlideParent) // Panelbar
- {
- top = parseInt(this.Element.style.top);
- if (isNaN(top)) top = 0;
- }
-
- if ( typeof(RadMenuItem) != "undefined" && this.Listener instanceof RadMenuItem)
- {
- if (this.Element.parentNode.style.height != this.Element.offsetHeight + top + "px")
- {
- this.Element.parentNode.style.height = Math.max(this.Element.offsetHeight + top, 0) + "px";
- }
-
- if (this.Element.parentNode.style.width != (this.Element.offsetWidth + left)+ "px")
- {
- this.Element.parentNode.style.width = Math.max(this.Element.offsetWidth + left, 0)+ "px";
- }
- }
- else
- {
- if (this.Element.parentNode.offsetHeight != this.Element.offsetHeight + top)
- {
- this.Element.parentNode.style.height = Math.max(this.Element.offsetHeight + top, 0) + "px";
- }
-
- if (this.Element.parentNode.offsetWidth != (this.Element.offsetWidth + left))
- {
- this.Element.parentNode.style.width = Math.max(this.Element.offsetWidth + left, 0)+ "px";
- }
- }
- },
-
-
- GetSize : function ()
- {
- return this.Horizontal ? this.Element.offsetWidth : this.Element.offsetHeight;
- },
- GetPosition : function ()
- {
- if (!this.Element.style[this.Side])
- {
- return 0;
- }
- return parseInt(this.Element.style[this.Side]);
- },
-
- SetPosition : function(value)
- {
- this.Element.style[this.Side] = value + "px";
- },
-
- Out : function ()
- {
- this.ResetState();
- this.Direction = -1;
- if (this.Invert)
- {
- this.Delta = this.GetSize() - this.GetPosition();
- }
- else
- {
- this.Delta = this.GetPosition() - this.GetSize();
- }
- this.Start(this.CollapseConfig);
- },
-
- In : function ()
- {
- this.ResetState(true);
- this.Direction = 1;
- this.Delta = - this.GetPosition();
- this.Start(this.ExpandConfig);
- },
- Start : function (configuration)
- {
- if (configuration.Type == "None")
- {
- this.UpdateContainerSize();
- this.Ticker.Stop();
-
- this.ChangePosition(this.InitialPosition + this.Delta);
- if (this.Overlay)
- {
- this.Overlay.Update();
- }
-
- this.UpdateContainerSize();
-
- this.OnTickEnd();
-
- return;
- }
- this.Tween = configuration.Type;
- this.Ticker.Configure(configuration);
- this.Ticker.Start();
- this.UpdateContainerSize();
- },
- ChangePosition : function (newValue)
- {
- if (isNaN(newValue)) return;
-
- var dimensionValue, dimensionName, dimensionOffset;
- if (this.Invert)
- {
- if (this.Horizontal)
- {
- dimensionValue = this.Element.offsetWidth;
- dimensionName = "width";
- dimensionOffset = this.OffsetX;
- }
- else
- {
- dimensionValue = this.Element.offsetHeight;
- dimensionName = "height";
- dimensionOffset = this.OffsetY;
- }
- this.SetPosition(0);
- var updatedValue = Math.max(1, dimensionValue - newValue) + "px";
- this.Element.parentNode.style[dimensionName] = updatedValue;
- this.Element.parentNode.style[this.Side] = ((dimensionValue - newValue + dimensionOffset) * -1) + "px";
- }
- else
- {
- this.Element.style[this.Side] = newValue + "px";
- }
- if (this.Listener && this.Listener.OnEase)
- this.Listener.OnEase(newValue);
- },
- OnTick : function (time)
- {
- var newValue = Math.round(Penner[this.Tween](time, this.InitialPosition, this.Delta, this.Ticker.Duration));
- if (newValue == this.InitialPosition + this.Delta)
- {
- this.Ticker.Stop();
- return;
- }
- this.ChangePosition(newValue);
- this.UpdateContainerSize();
- if (this.Overlay)
- {
- this.Overlay.Update();
- }
- },
-
- OnTickEnd : function ()
- {
- try
- {
- if (this.Direction == 0)
- {
- return;
- }
-
- this.ChangePosition(this.InitialPosition + this.Delta);
-
- if (this.Overlay)
- {
- this.Overlay.Update();
- }
-
- if (this.Direction > 0)
- {
- this.Element.parentNode.style.overflow = "visible";
- if (this.Listener && this.Listener.OnExpandComplete)
- {
- this.Listener.OnExpandComplete();
- }
- }
- else
- {
- this.Element.parentNode.style.display = "none";
- if (this.Listener)
- {
- this.Listener.OnCollapseComplete();
- }
- }
-
- this.Direction = 0;
- }
- catch(e)
- {
- //Atlas updates
- }
- }
- }
- }
- //BEGIN_ATLAS_NOTIFY
- if (typeof(Sys) != "undefined")
- {
- if (Sys.Application != null && Sys.Application.notifyScriptLoaded != null)
- {
- Sys.Application.notifyScriptLoaded();
- }
- }
- //END_ATLAS_NOTIFY
|