Skip to content

Commit

Permalink
Merge pull request #88 from basho/csm-default-replacement
Browse files Browse the repository at this point in the history
Provide a default selection.
  • Loading branch information
cmeiklejohn committed May 1, 2013
2 parents 9218e77 + 8599f56 commit 1b30368
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions priv/admin/js/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,23 @@ minispade.register('cluster', function() {
itemViewClass: RiakControl.StagedClusterItemView
});

/**
* @class
*
* View for select menus in cluster item actions boxes.
*/
RiakControl.ClusterItemSelectView = Ember.Select.extend({

/*
* When the select menu changes, update its display.
*/
change: function () {
var item = this.$(),
val = item.val();
Ember.run.next(function() {
item.parent().find('.gui-dropdown-bg').text(val);
});
}
});

});
2 changes: 1 addition & 1 deletion priv/admin/js/generated/templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion priv/admin/js/templates/current_cluster_item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<div class="gui-dropdown-wrapper replacement-node-dropdown">
<div class="gui-dropdown-bg gui-text">Select Replacement Node</div>
<div class="gui-dropdown-cap left"></div>
{{view Ember.Select classNames="gui-dropdown" contentBinding="controller.joiningNodes" optionLabelPath="content.name"}}
{{view RiakControl.ClusterItemSelectView prompt="Select Replacement Node" classNames="gui-dropdown" contentBinding="controller.joiningNodes" optionLabelPath="content.name"}}
</div>
<div class="gui-checkbox-wrapper">
<input class="gui-checkbox" type="checkbox" {{bindAttr name="name" id="forceReplaceCheck"}} value="true" />
Expand Down

0 comments on commit 1b30368

Please sign in to comment.