Skip to content

Commit

Permalink
Build the Help Panel at startup in WiringEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
ericabouaf committed Mar 2, 2009
1 parent 366b697 commit 56a7dbc
Showing 1 changed file with 42 additions and 25 deletions.
67 changes: 42 additions & 25 deletions js/WiringEditor.js
Expand Up @@ -75,6 +75,19 @@ WireIt.WiringEditor = function(options) {
*/
this.el = Dom.get(options.parentEl);

/**
* @property helpPanel
* @type {YAHOO.widget.Panel}
*/
this.helpPanel = new widget.Panel('helpPanel', {
fixedcenter: true,
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.helpPanel.render();

/**
* @property layout
* @type {YAHOO.widget.Layout}
Expand Down Expand Up @@ -231,6 +244,7 @@ WireIt.WiringEditor.prototype = {

/**
* WiringEditor uses a SMD to connect to the backend
* @method loadSMD
*/
loadSMD: function() {

Expand All @@ -242,13 +256,20 @@ WireIt.WiringEditor.prototype = {

},

/**
* callback for loadSMD request
* @method onSMDsuccess
*/
onSMDsuccess: function() {
//console.log("onSMDsuccess",this.service);
},
onSMDfailure: function() {

console.log("onSMDfailure", this.service);


/**
* callback for loadSMD request
* @method onSMDfailure
*/
onSMDfailure: function() {
//console.log("onSMDfailure", this.service);
},

/**
Expand Down Expand Up @@ -294,16 +315,6 @@ WireIt.WiringEditor.prototype = {
* @method onHelp
*/
onHelp: function() {
if( !this.helpPanel) {
this.helpPanel = new widget.Panel('helpPanel', {
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.helpPanel.render();
this.helpPanel.center();
}
this.helpPanel.show();
},

Expand Down Expand Up @@ -339,21 +350,27 @@ WireIt.WiringEditor.prototype = {
this.saveModule();
},

/**
* @method renderLoadPanel
*/
renderLoadPanel: function() {
if( !this.loadPanel) {
this.loadPanel = new widget.Panel('WiringEditor-loadPanel', {
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.loadPanel.setHeader("Select module");
this.loadPanel.setBody("<div id='loadPanelBody'></div>");
this.loadPanel.render(document.body);
// this.loadPanel.center();
this.loadPanel = new widget.Panel('WiringEditor-loadPanel', {
fixedcenter: true,
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.loadPanel.setHeader("Select module");
this.loadPanel.setBody("<div id='loadPanelBody'></div>");
this.loadPanel.render(document.body);
}
},


/**
* @method updateLoadPanelList
*/
updateLoadPanelList: function() {
var list = WireIt.cn("ul");
if(lang.isArray(this.pipes)) {
Expand Down

0 comments on commit 56a7dbc

Please sign in to comment.