From: Aleksander Ɓukasz Date: Tue, 25 Mar 2014 13:51:16 +0000 (+0100) Subject: editor: openSelect view - maxHeight/maxWidth options X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ef2d50fc31d5702a1c624a2cdc31cacb0e750c68 editor: openSelect view - maxHeight/maxWidth options --- diff --git a/src/editor/modules/metadataEditor/metadataEditor.less b/src/editor/modules/metadataEditor/metadataEditor.less index e214e71..caed061 100644 --- a/src/editor/modules/metadataEditor/metadataEditor.less +++ b/src/editor/modules/metadataEditor/metadataEditor.less @@ -40,4 +40,8 @@ padding:3px; line-height:10px; } + + .drop-menu { + overflow: auto; + } } \ No newline at end of file diff --git a/src/editor/views/openSelect/openSelect.js b/src/editor/views/openSelect/openSelect.js index 718a4a0..ef5b94a 100644 --- 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); } + 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'); diff --git a/src/editor/views/openSelect/openSelect.less b/src/editor/views/openSelect/openSelect.less index 4031ce5..6209696 100644 --- a/src/editor/views/openSelect/openSelect.less +++ b/src/editor/views/openSelect/openSelect.less @@ -18,4 +18,8 @@ width: calc(~"100% - 1em"); margin-top: -@lineHeight; } + + .dropdown-menu { + overflow: auto; + } } \ No newline at end of file