Renamed resultViewCtrl to cmdController

This commit is contained in:
Borys Levytskyi
2015-04-04 19:55:23 +03:00
parent 8d8aa60142
commit f1aee5be38
4 changed files with 6 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ app.run(function() {
return new app.models.HelpResult();
},
'clear': function() {
app.controller('resultViewCtrl').clear();
app.controller('cmdController').clear();
},
'em': function() {
var cfg = app.get('cmdConfig');

View File

@@ -4,14 +4,13 @@ app.compose(function() {
app.set('dispatcher', function() {
var handlers = [];
var is = app.get('is');
var resultView = app.controller('resultViewCtrl');
var cmdController = app.controller('cmdController');
return {
dispatch: function(rawInput) {
var input = rawInput.trim();
var handler = this.findHandler(input);
if(handler != null) {
if(app.debugMode) {
@@ -77,12 +76,12 @@ app.compose(function() {
var cmdResult = handler.handle(input);
if(cmdResult != null) {
var r = new app.models.DisplayResult(input, cmdResult);
resultView.display(r);
cmdController.display(r);
}
},
displayCommandError: function (input, message) {
var error = new app.models.ErrorResult(message);
resultView.display(new app.models.DisplayResult(input, error));
cmdController.display(new app.models.DisplayResult(input, error));
}
};
});

View File

@@ -53,7 +53,7 @@ app.compose(function() {
}
});
app.controller('resultViewCtrl', function() {
app.controller('cmdController', function() {
var html = app.get('html');
return {

View File

@@ -50,7 +50,7 @@
</span>
</div>
<div id="output" data-controller="resultViewCtrl">
<div id="output" data-controller="cmdController">
</div>
<script data-template="helpResultTpl" type="text/template">