Skip to content

Commit

Permalink
Refactor switch button
Browse files Browse the repository at this point in the history
  • Loading branch information
roboshoes committed Feb 11, 2011
1 parent 2beb9bc commit dee23ce
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions public/javascripts/marblerun/main.js
Expand Up @@ -104,29 +104,22 @@ var initializeHTMLInterface = (function() {

var myScope = this;

/*
$('modeSwitch').observe('click', function(event) {
if (myScope.currentMode === "view") {
setSwitchMode("build");
contentLoader.parseResponse({responseJSON: {mode: "build"}}, true);
} else {
setSwitchMode("view");
contentLoader.loadContent(getCurrentOverViewPath(), true);
$('buildSwitch').observe('click', function(event) {

if ($('modeSwitch').hasClassName("build")) {
return;
}
});
*/

$('buildSwitch').observe('click', function(event) {
setSwitchMode("build");
contentLoader.parseResponse({responseJSON: {mode: "build"}}, true);
});

$('viewSwitch').observe('click', function(event) {

if ($('modeSwitch').hasClassName("view")) {
return;
}

setSwitchMode("view");
contentLoader.loadContent(getCurrentOverViewPath(), true);
});
Expand Down

0 comments on commit dee23ce

Please sign in to comment.