1/** 2 * ë ¸ëíì Web UX Select ì¤í¬ë¦½í¸ Framework 3 * v.1.3 4 * ---------------------------------------------------------------------- 5 * ìì±ì : kgi0412 6 * ìµì¢ ìì ì¼ : 2019.10.31 7 * ---------------------------------------------------------------------- 8 */ 9!function(e){e.extend({_YBSelect:function(t,n){var i={_objKey:"ybSelect",_element:t,defaultOptionLabel:"ì í",dataTextField:"text",dataValueField:"value",isActive:!0,height:380};n=e.extend(!0,this,i,n),t.data(n._objKey,this),this._init=function(){if(n.dataSource&&"object"===e.type(n.dataSource)&&n.dataSource.remote&&"object"===e.type(n.dataSource.remote)){var i=n.dataSource.remote;e.getJSON(i.url,i.data,function(i){i&&"array"===e.type(i)&&(n.dataSource=i),e._YBSelectCreation(t,n),e._YBSelectVisualMaker(t,n)})}else e._YBSelectCreation(t,n),e._YBSelectVisualMaker(t,n);n._reset()},this._setOptionSelected=function(i){var a=t.find("button.currSel"),o=t.find("select option"),c=n.defaultOptionLabel;o.prop("selected",!1),i>-1?c=o.eq(i).prop("selected",!0).text():(t.find("select").val(""),c=n.optionLabel?"string"===e.type(n.optionLabel)?n.optionLabel:n.defaultOptionLabel:o.eq(0).prop("selected",!0).text()),a.text(c),t.find("select").trigger("change"),n._cascading()},this._cascading=function(){var i="string"===e.type(n.cascadeTo)&&e(n.cascadeTo).data("ybSelect");if(i){i._reset();var a=i.onCascading;"function"===e.type(a)&&a(t.find("select").val())}},this._reset=function(){this._setOptionSelected()},this._closeSelectBox=function(){t.removeClass("on bot").find(".list").removeAttr("style")},this.setDataSource=function(e){n.dataSource=e,n._init(),n._cascading()},this.getValue=function(){return t.find("select").val()},this.setValue=function(e){var i=t.find("select option[value='"+e+"']").index();i>-1&&n._setOptionSelected(i)},this.getData=function(e){return t.find("ul.list li").eq(e).data()}
9,this.getSelectedData=function(){var e=t.find("select option:selected").index();return n.getData(e)},this.getSelectElement=function(){return t.find("select")},this.toggle=function(i){"boolean"!==e.type(i)&&(i=t.hasClass("disabled")),n.isActive=i,n.isActive?t.removeClass("disabled"):t.addClass("disabled")},this.clean=function(){n._reset()},this._init()},_YBSelectCreation:function(t,n){!n.isActive&&t.addClass("disabled");var i=t.find("select");return(!i||i.length<1)&&(i=e("<select/>").appendTo(t)),n.dataSource&&"array"===e.type(n.dataSource)&&e.each(n.dataSource,function(t,a){0==t&&i.find("option").remove(),"object"===e.type(a)&&e("<option/>",{value:a[n.dataValueField]}).text(a[n.dataTextField]).appendTo(i)}),n.addItems&&"array"===e.type(n.addItems)&&e.each(n.addItems,function(t,a){if("object"===e.type(a)){var o=e("<option/>",{value:a[n.dataValueField]}).text(a[n.dataTextField]);"FIRST"===a.position?o.prependTo(i):o.appendTo(i)}}),t},_YBSelectVisualMaker:function(t,n){var i=t.find("div.selectIn");(!i||i.length<1)&&(i=e("<div/>",{class:"selectIn"}).append(e("<button/>",{type:"button",class:"currSel"}),e("<ul/>",{class:"list"})).appendTo(t));var a=i.find("ul.list").empty();t.find("select option").each(function(t,i){var o=e("<li/>").append(e("<button/>",{type:"button",value:e(this).val()}).text(e(this).text())).appendTo(a);e(n.dataSource)[t]&&o.data(e(n.dataSource)[t])});var o=t.find("select");i.width(o.width());var c=i.find("button.currSel");return c.text(o.find("option:selected").text()),c.off().on("click",function(o){if(o.preventDefault(),t.hasClass("on"))n._closeSelectBox();else{e._YBSelectClean(),t.addClass("on"),a.find("li:eq(0)").outerHeight()<n.height&&a.height()>n.height&&a.css({height:n.height});var l=i.offset().top+a.height()-e(window).scrollTop()+i.height();e(window).height()<l&&i.offset().top>a.height()&&(t.addClass("bot"),a.css({bottom:c.outerHeight()}))}}),c.on("keydown",function(e){var t=e.keyCode?e.keyCode:e.which,i=o.find("option:selected").index(),a=o.find("option").size();console.log(i,a),27==t&&n._closeSelectBox(),38==t&&i>0?--i:40==t&&i<a-1&&++i,38!=t&&40!=t||n._setOptionSelected(i),9!=t&&e.preventDefault()}),a.off().on("click","li",function(t){t.preventDefault(),n._setOptionSelected(e(this).index()),n._closeSelectBox()}),t},_YBSelectClean:function(){e(document).find(".select, .yb_select").removeClass("on bot").find(".list").removeAttr("style")},ybSelect:function(t,n){var i,a;return"string"===e.type(t)?(i=e(t),n&&"object"===e.type(n)&&(a=n)):e.ybLog.e(e._YBSelect._objKey,"첫ë²ì§¸ ì¸ìê° $ì íì(selector)ì¸ì§ íì¸íì¸ì."),i&&i.ybSelect(a).data("ybSelect")}}),e.fn.extend({ybSelect:function(t){return this.each(function(n,i){new e._YBSelect(e(i),t)})}}),e(document).on("click","#wrap",function(t){e(".select").has(t.target).length||e._YBSelectClean()}),e(document).ready(function(){e(".yb_select").ybSelect()})}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.