Skip to content
Snippets Groups Projects
Commit 059454e0 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update toggleShellWindow()

parent c31ca3b1
No related branches found
No related tags found
1 merge request!576561 add winbox
...@@ -42,43 +42,47 @@ function hideModalMessage(){ ...@@ -42,43 +42,47 @@ function hideModalMessage(){
return false; return false;
} }
var aWinBoxes={}; var aWinBoxes={};
/** /**
* shellcmd plugin ... toggle output window * shellcmd plugin ... toggle output window
* @param {string} idWrapperDiv id of the wrapper * @param {string} isPluginOutputDiv id of the wrapper
* @param {object} oLink a tag in the navbar with link for toggling window * @param {object} oLink a tag in the navbar with link for toggling window
*/ */
function toggleShellWindow(idWrapperDiv, oLink){ function toggleShellWindow(isPluginOutputDiv, oLink){
if(aWinBoxes[idWrapperDiv]){ if(aWinBoxes[isPluginOutputDiv]){
aWinBoxes[idWrapperDiv].close(); aWinBoxes[isPluginOutputDiv].close();
} else { } else {
var oWrapper=document.getElementById(idWrapperDiv); var oWrapper=document.getElementById(isPluginOutputDiv);
aWinBoxes[idWrapperDiv] = WinBox({ aWinBoxes[isPluginOutputDiv] = WinBox({
title: oLink.innerText, title: oLink.innerText,
id: 'winbox-'+idWrapperDiv, id: 'winbox-'+isPluginOutputDiv,
border: 5, border: 5,
background: "#628", background: "#628",
class: [ "no-min", "no-max", /* "no-full", "no-resize", "no-move"*/ "ciwinbox" ], class: [ "no-min", "no-max", /* "no-full", "no-resize", "no-move"*/ "ciwinbox" ],
// position: // position + size
x: "center", x: "center",
y: "center", y: "center",
width: 10,
height: 10,
// width: oWrapper.clientWidth+'px', // viewport
top: 70,
right: 20,
bottom: 20,
left: 20,
// take content from existing div
mount: oWrapper, mount: oWrapper,
onclose: function(){ onclose: function(){
delete aWinBoxes[idWrapperDiv]; delete aWinBoxes[isPluginOutputDiv];
$(oLink).parent().removeClass('active'); $(oLink).parent().removeClass('active');
} }
}); });
$(oLink).parent().addClass('active'); $(oLink).parent().addClass('active');
window.setTimeout("aWinBoxes['"+idWrapperDiv+"'].resize("+(oWrapper.clientWidth+25)+", "+(oWrapper.clientHeight+150)+").move('center', 'center')", 200); window.setTimeout("aWinBoxes['"+isPluginOutputDiv+"'].resize("+(oWrapper.clientWidth+25)+", "+(oWrapper.clientHeight+150)+").move('center', 'center')", 10);
} }
// $('#'+idWrapperDiv).slideToggle(100);
// $(oLink).parent().toggleClass('active');
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment