diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index a2b787e1c..83c9068eb 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -168,6 +168,9 @@ margin-bottom: 0; } } + .cp-alertify-type-container { + overflow: visible !important; + } .alertify-tabs { max-height: 100%; display: flex; diff --git a/customize.dist/src/less2/include/buttons.less b/customize.dist/src/less2/include/buttons.less index fb99471b6..ad6aaf9cc 100644 --- a/customize.dist/src/less2/include/buttons.less +++ b/customize.dist/src/less2/include/buttons.less @@ -23,6 +23,23 @@ } } + div.cp-alertify-type { + display: flex; + input { + margin: 0; + flex: 1; + min-width: 0; + } + span { + button { + margin: 0; + height: 100%; + margin-left: -1px; + text-transform: unset !important; + } + } + } + textarea { padding: 8px; &[readonly] { diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index 10044528e..271603216 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -17,8 +17,7 @@ button { .fa-caret-down { - margin-right: 0px; - margin-left: 5px; + margin-right: 1em !important; } * { .tools_unselectable(); diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 55d7e6939..d4b3059b4 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -161,6 +161,17 @@ define([ return h('p.msg', h('input', attrs)); }; + dialog.textTypeInput = function (dropdown) { + var attrs = { + type: 'text', + 'class': 'cp-text-type-input', + }; + return h('p.msg.cp-alertify-type-container', h('div.cp-alertify-type', [ + h('input', attrs), + dropdown // must be a "span" + ])); + }; + dialog.nav = function (content) { return h('nav', content || [ dialog.cancelButton(), @@ -186,6 +197,7 @@ define([ }); }; return $frame.click(function (e) { + $frame.find('.cp-dropdown-content').hide(); e.stopPropagation(); })[0]; }; @@ -480,7 +492,8 @@ define([ cb = cb || function () {}; opt = opt || {}; - var inputBlock = opt.password ? UI.passwordInput() : dialog.textInput(); + var inputBlock = opt.password ? UI.passwordInput() : + (opt.typeInput ? dialog.textTypeInput(opt.typeInput) : dialog.textInput()); var input = $(inputBlock).is('input') ? inputBlock : $(inputBlock).find('input')[0]; input.value = typeof(def) === 'string'? def: ''; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index a195a1ba9..eb032bfaf 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2896,9 +2896,11 @@ define([ var $button = $('