/*
* jQuery SDE Page Actions plugin
*
*
*
*/
(function($) {
var pageStack = new Array();
$.fn.sdePageActions = function(cmd) {
if (cmd == undefined) { cmd = ""; }
var containers = $(".PageActionContainer");
switch (cmd.toLowerCase()) {
case "pop":
//remove the current links
var items = pageStack.pop();
if (items != undefined) {
$(items).remove();
}
//display the previous link set
if (pageStack.length > 0) {
$(pageStack[pageStack.length - 1]).show();
}
break;
case "push":
default:
//Hide the display of the existing links
var children = $(containers).children();
$(children).hide();
//If stack is empty add any children to the stack
if (pageStack.length == 0) {
pageStack.push(children);
}
//Add new link items to the stack and display them
pageStack.push(this);
this.appendTo($(containers));
break;
}
return this;
};
})(jQuery);