- Remove inputType from previous check in. Will replace with MaskEditTextView stuff

* Cleanup self.options in Views. Just use self.XXXXXX and pass in options to configure
* View's take one param for ctor: options. Including options.client
* Experimental / WIP cursor show/hide in Views
This commit is contained in:
Bryan Ashby 2015-04-08 22:54:13 -06:00
parent 6d84018ef5
commit 2bac8e006e
10 changed files with 123 additions and 81 deletions

View file

@ -9,31 +9,31 @@ var assert = require('assert');
exports.MenuView = MenuView;
function MenuView(client, options) {
function MenuView(options) {
options.acceptsFocus = miscUtil.valueWithDefault(options.acceptsFocus, true);
options.acceptsInput = miscUtil.valueWithDefault(options.acceptsInput, true);
View.call(this, client, options);
View.call(this, options);
var self = this;
if(this.options.items) {
this.setItems(this.options.items);
if(options.items) {
this.setItems(options.items);
} else {
this.items = [];
}
this.focusedItemIndex = this.options.focusedItemIndex || 0;
this.focusedItemIndex = options.focusedItemIndex || 0;
this.focusedItemIndex = this.items.length >= this.focusedItemIndex ? this.focusedItemIndex : 0;
this.itemSpacing = this.options.itemSpacing || 1;
this.itemSpacing = options.itemSpacing || 1;
this.itemSpacing = parseInt(this.itemSpacing, 10);
this.focusPrefix = this.options.focusPrefix || '';
this.focusSuffix = this.options.focusSuffix || '';
this.focusPrefix = options.focusPrefix || '';
this.focusSuffix = options.focusSuffix || '';
this.fillChar = miscUtil.valueWithDefault(this.options.fillChar, ' ').substr(0, 1);
this.justify = this.options.justify || 'none';
this.fillChar = miscUtil.valueWithDefault(options.fillChar, ' ').substr(0, 1);
this.justify = options.justify || 'none';
this.moveSelection = function(fromIndex, toIndex) {
assert(!self.positionCacheExpired);