Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Disable Record button if a non-Chrome agent is selected. Fixes #121
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliseo Soto committed Mar 6, 2012
1 parent ce93d4b commit 5b67bb5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/control-room/main.reel/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"boundObjectPropertyPath": "agents.selectedObjects",
"oneway": true
},
"selectedAgent": {
"boundObject": {"@": "owner"},
"boundObjectPropertyPath": "agents.selectedObjects.0",
"oneway": true
},
"serverVersion": {
"boundObject": {"@": "owner"},
"boundObjectPropertyPath": "serverVersion",
Expand Down
29 changes: 29 additions & 0 deletions public/control-room/main.reel/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ exports.Main = Montage.create(Component, {
value: null
},

activeAgents: {
value: null
},

selectedAgent: {
value: null
},

scriptSource: {
value: null
},

serverVersion: {
value: ""
},
Expand Down Expand Up @@ -104,6 +116,10 @@ exports.Main = Montage.create(Component, {
self.scriptChanged(event.plus, event.minus);
}, false);

this.scriptDetail.addEventListener("change@selectedAgent", function(event) {
self.selectedAgentChanged(event.plus, event.minus);
}, false);

this.scriptDetail.addEventListener("scriptDeleted", function(event) {
self.scripts.remove();
self.scripts.selectedObjects = [];
Expand Down Expand Up @@ -226,5 +242,18 @@ exports.Main = Montage.create(Component, {
localStorage["Screening.AppState.CurrentScript"] = newScript.id;
}
}
},

selectedAgentChanged: {
value: function(newAgent, prevAgent) {
var self = this;

if (newAgent && newAgent.info.capabilities.browserName !== "chrome") {
self.scriptDetail.recordButton.disabled = true;
} else {
self.scriptDetail.recordButton.disabled = false;
}

}
}
});

0 comments on commit 5b67bb5

Please sign in to comment.