fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: canvas links fix
[fnpeditor.git]
/
src
/
editor
/
views
/
openSelect
/
openSelect.js
diff --git
a/src/editor/views/openSelect/openSelect.js
b/src/editor/views/openSelect/openSelect.js
index
cc94854
..
ef5b94a
100644
(file)
--- a/
src/editor/views/openSelect/openSelect.js
+++ b/
src/editor/views/openSelect/openSelect.js
@@
-24,6
+24,12
@@
var OpenSelect = Backbone.View.extend({
this.input = $(this.options.inputTemplate);
this.$('.input-wrapper').append(this.input);
}
this.input = $(this.options.inputTemplate);
this.$('.input-wrapper').append(this.input);
}
+ if(this.options.maxHeight) {
+ this.menu.css('max-height', this.options.maxHeight);
+ }
+ if(this.options.maxWidth) {
+ this.menu.css('max-width', this.options.maxWidth);
+ }
},
toggleHandler: function(toggle) {
this.$('.toggle').css('visibility', toggle ? 'inherit' : 'hidden');
},
toggleHandler: function(toggle) {
this.$('.toggle').css('visibility', toggle ? 'inherit' : 'hidden');
@@
-36,11
+42,14
@@
var OpenSelect = Backbone.View.extend({
this.menu.empty();
this.toggleHandler(false);
},
this.menu.empty();
this.toggleHandler(false);
},
- onSelection: function(e) {
- var val = $(e.target).text();
+ setInput: function(value) {
if(this.options.setInput) {
if(this.options.setInput) {
- this.options.setInput(this.input, val);
+ this.options.setInput(this.input, val
ue
);
}
}
+ },
+ onSelection: function(e) {
+ var val = $(e.target).text();
+ this.setInput(val);
this.trigger('itemSelected', this.input.val());
}
});
this.trigger('itemSelected', this.input.val());
}
});