mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
Merge pull request #21 from ONLYOFFICE/fix/fixForSelect2
Select2 view fixes.
This commit is contained in:
@ -49,5 +49,5 @@ if (document.currentScript && document.currentScript.src) {
|
||||
// escape and unescape func
|
||||
!function(e){function n(n){function t(e){return n[e]}var e="(?:"+Object.keys(n).join("|")+")",u=RegExp(e),c=RegExp(e,"g");return function(e){return e=null==e?"":""+e,u.test(e)?e.replace(c,t):e}}escape=n({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),unescape=n({"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"}),e.escape=escape,e.unescape=unescape}(window);
|
||||
|
||||
// select2 fix search field
|
||||
var select2_amd,select2_defaults;"undefined"!=typeof jQuery&&void 0!==$.fn.select2&&(select2_amd=$.fn.select2.amd,select2_defaults=$.fn.select2.defaults,select2_amd.define("SearchableSingleSelection",["select2/utils","select2/selection/single","select2/selection/eventRelay","select2/dropdown/search"],function(e,t,n,s){var l=e.Decorate(t,s);(l=e.Decorate(l,n)).prototype.render=function(){var e=s.prototype.render.call(this,t.prototype.render);return this.$searchContainer.hide(),this.$element.siblings(".select2").find(".selection").prepend(this.$searchContainer),e};var r=l.prototype.bind;return l.prototype.bind=function(e){var t=this;r.apply(this,arguments),e.on("open",function(){t.$selection.hide(),t.$searchContainer.show()}),e.on("close",function(){t.$searchContainer.hide(),t.$selection.show()})},l}),select2_amd.define("UnsearchableDropdown",["select2/utils","select2/dropdown","select2/dropdown/attachBody","select2/dropdown/closeOnSelect"],function(e,t,n,s){n=e.Decorate(t,n);return n=e.Decorate(n,s)}),select2_amd.define("jquery.select2_",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,e,c,t,o){var a;return null!=r.fn.select2&&(a=["open","close","destroy"],r.fn.select2=function(t){if((t=t||{}).selectionAdapter=r.fn.select2.amd.require("SearchableSingleSelection"),t.dropdownAdapter=r.fn.select2.amd.require("UnsearchableDropdown"),"object"==typeof t){this.each(function(){var e=r.extend(!0,{},t);new c(r(this),e)});var e=this.next().find(".select2-search.select2-search--dropdown"),n=this.next().find("span.selection").find(".select2-selection__arrow").clone();return r(n[0]).appendTo(e),this}if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var s,l=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),s=e[t].apply(e,l)}),-1<r.inArray(t,a)?this:s}),null==r.fn.select2.defaults&&(r.fn.select2.defaults=t),c}),$.fn.select2.amd.require("jquery.select2_"),$.fn.select2.amd=select2_amd,$.fn.select2.defaults=select2_defaults);
|
||||
// select2 fix search field
|
||||
var select2_amd,select2_defaults;"undefined"!=typeof jQuery&&null!=$.fn.select2&&(select2_amd=$.fn.select2.amd,select2_defaults=$.fn.select2.defaults,$.fn.select2.amd.define("SearchableSingleSelection",["select2/utils","select2/selection/single","select2/selection/eventRelay","select2/dropdown/search"],function(e,t,n,l){var s=e.Decorate(t,l);(s=e.Decorate(s,n)).prototype.render=function(){var e=l.prototype.render.call(this,t.prototype.render);return this.$searchContainer.hide(),this.$element.siblings(".select2").find(".selection").prepend(this.$searchContainer),e};var c=s.prototype.bind;return s.prototype.bind=function(e){var t=this;c.apply(this,arguments),e.on("open",function(){t.$selection.hide(),t.$searchContainer.show()}),e.on("close",function(){t.$searchContainer.hide(),t.$selection.show()})},s}),$.fn.select2.amd.define("UnsearchableDropdown",["select2/utils","select2/dropdown","select2/dropdown/attachBody","select2/dropdown/closeOnSelect"],function(e,t,n,l){n=e.Decorate(t,n);return n=e.Decorate(n,l)}),select2_amd.define("jquery.select2_",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(s,e,c,t,o){var r;return null!=s.fn.select2&&(r=["open","close","destroy"],s.fn.select2=function(l){if((l=l||{}).selectionAdapter=!1!==l.selectionAdapter?select2_amd.require("SearchableSingleSelection"):void 0,l.dropdownAdapter=!1!==l.dropdownAdapter?select2_amd.require("UnsearchableDropdown"):void 0,"object"==typeof l)return this.each(function(){var e=s.extend(!0,{},l),t=new c(s(this),e),n=s(this).next().find(".select2-search.select2-search--dropdown"),e=s(this).next().find("span.selection").find(".select2-selection__arrow").clone();s(e).click(function(){t.close()}),e.appendTo(n)}),this;if("string"!=typeof l)throw new Error("Invalid arguments for Select2: "+l);var t,n=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+l+"') method was called on an element that is not using Select2."),t=e[l].apply(e,n)}),-1<s.inArray(l,r)?this:t}),null==s.fn.select2.defaults&&(s.fn.select2.defaults=t),c}),$.fn.select2.amd.require("jquery.select2_"),$.fn.select2.amd=select2_amd,$.fn.select2.defaults=select2_defaults);
|
||||
@ -406,6 +406,9 @@ a.aboutlink:active {
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected=true] {
|
||||
background-color: #7d858c !important;
|
||||
}
|
||||
.select2-search.select2-search--dropdown .select2-selection__arrow {
|
||||
cursor: pointer !important
|
||||
}
|
||||
/*
|
||||
* Container style
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user