diff --git a/dist/jquery.tree-multiselect.css b/dist/jquery.tree-multiselect.css index c9402ee..ab38361 100644 --- a/dist/jquery.tree-multiselect.css +++ b/dist/jquery.tree-multiselect.css @@ -1,4 +1,4 @@ -/* jQuery Tree Multiselect v2.4.0 | (c) Patrick Tsai | MIT Licensed */ +/* jQuery Tree Multiselect v2.4.1 | (c) Patrick Tsai | MIT Licensed */ div.tree-multiselect { border: 2px solid #D8D8D8; border-radius: 5px; @@ -8,12 +8,10 @@ div.tree-multiselect { div.tree-multiselect > div.selected, div.tree-multiselect > div.selections { display: inline-block; - vertical-align: top; box-sizing: border-box; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - display: table-cell; + overflow: auto; padding: 1%; + vertical-align: top; width: 50%; } div.tree-multiselect > div.selections { border-right: solid 2px #D8D8D8; } @@ -27,9 +25,10 @@ div.tree-multiselect { div.tree-multiselect > div.selections.no-border { border-right: none; } div.tree-multiselect > div.selected > div.item { - padding: 2px 5px; + background: #EAEAEA; border-radius: 2px; - background: #EAEAEA; } + padding: 2px 5px; + overflow: auto; } div.tree-multiselect > div.selected.ui-sortable > div.item:hover { cursor: move; } div.tree-multiselect div.section > div.section, @@ -63,20 +62,20 @@ div.tree-multiselect { cursor: pointer; } div.tree-multiselect span.remove-selected, div.tree-multiselect span.description { - padding: 0 3px; - margin-right: 5px; background: #777; + border-radius: 2px; color: white; - border-radius: 2px; } + margin-right: 5px; + padding: 0 3px; } div.tree-multiselect span.remove-selected:hover { cursor: pointer; } div.tree-multiselect span.description:hover { cursor: help; } div.tree-multiselect div.temp-description-popup { background: #EAEAEA; - padding: 5px; border: 2px solid #676767; - border-radius: 3px; } + border-radius: 3px; + padding: 5px; } div.tree-multiselect span.section-name { float: right; font-style: italic; } @@ -84,18 +83,18 @@ div.tree-multiselect { display: table; width: 100%; } div.tree-multiselect .auxiliary input.search { - padding: 5px; - margin: 0; border: 2px solid #D8D8D8; display: table-cell; + margin: 0; + padding: 5px; width: 100%; } div.tree-multiselect .auxiliary .select-all-container { display: table-cell; text-align: right; } div.tree-multiselect .auxiliary .select-all-container span.select-all, div.tree-multiselect .auxiliary .select-all-container span.unselect-all { - padding-right: 5px; - margin-right: 5px; } + margin-right: 5px; + padding-right: 5px; } div.tree-multiselect .auxiliary .select-all-container span.select-all:hover, div.tree-multiselect .auxiliary .select-all-container span.unselect-all:hover { cursor: pointer; } diff --git a/dist/jquery.tree-multiselect.js b/dist/jquery.tree-multiselect.js index 3607d86..d85a358 100644 --- a/dist/jquery.tree-multiselect.js +++ b/dist/jquery.tree-multiselect.js @@ -1,4 +1,4 @@ -/* jQuery Tree Multiselect v2.4.0 | (c) Patrick Tsai | MIT Licensed */ +/* jQuery Tree Multiselect v2.4.1 | (c) Patrick Tsai | MIT Licensed */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;odiv.selected,div.tree-multiselect>div.selections{display:inline-block;vertical-align:top;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;display:table-cell;padding:1%;width:50%}div.tree-multiselect>div.selections{border-right:solid 2px #D8D8D8}div.tree-multiselect>div.selections div.item{margin-left:16px}div.tree-multiselect>div.selections div.item label{cursor:pointer;display:inline}div.tree-multiselect>div.selections div.item label.disabled{color:#D8D8D8}div.tree-multiselect>div.selections.no-border{border-right:none}div.tree-multiselect>div.selected>div.item{padding:2px 5px;border-radius:2px;background:#EAEAEA}div.tree-multiselect>div.selected.ui-sortable>div.item:hover{cursor:move}div.tree-multiselect div.section>div.section,div.tree-multiselect div.section>div.item{padding-left:20px}div.tree-multiselect div.section.collapsed>div.title span.collapse-section:after{content:"+"}div.tree-multiselect div.section.collapsed:not([searchhit])>.item,div.tree-multiselect div.section.collapsed:not([searchhit])>.section{display:none}div.tree-multiselect div.title,div.tree-multiselect div.item{margin-bottom:2px}div.tree-multiselect div.title{background:#777;color:white;padding:2px}div.tree-multiselect div.title>*{display:inline-block}div.tree-multiselect div.title>span.collapse-section{margin:0 3px;width:8px}div.tree-multiselect div.title>span.collapse-section:after{content:"-"}div.tree-multiselect div.title:hover{cursor:pointer}div.tree-multiselect input[type=checkbox]{display:inline;margin-right:5px}div.tree-multiselect input[type=checkbox]:not([disabled]):hover{cursor:pointer}div.tree-multiselect span.remove-selected,div.tree-multiselect span.description{padding:0 3px;margin-right:5px;background:#777;color:white;border-radius:2px}div.tree-multiselect span.remove-selected:hover{cursor:pointer}div.tree-multiselect span.description:hover{cursor:help}div.tree-multiselect div.temp-description-popup{background:#EAEAEA;padding:5px;border:2px solid #676767;border-radius:3px}div.tree-multiselect span.section-name{float:right;font-style:italic}div.tree-multiselect .auxiliary{display:table;width:100%}div.tree-multiselect .auxiliary input.search{padding:5px;margin:0;border:2px solid #D8D8D8;display:table-cell;width:100%}div.tree-multiselect .auxiliary .select-all-container{display:table-cell;text-align:right}div.tree-multiselect .auxiliary .select-all-container span.select-all,div.tree-multiselect .auxiliary .select-all-container span.unselect-all{padding-right:5px;margin-right:5px}div.tree-multiselect .auxiliary .select-all-container span.select-all:hover,div.tree-multiselect .auxiliary .select-all-container span.unselect-all:hover{cursor:pointer}div.tree-multiselect .auxiliary .select-all-container span.select-all{border-right:2px solid #D8D8D8} +/* jQuery Tree Multiselect v2.4.1 | (c) Patrick Tsai | MIT Licensed */ +div.tree-multiselect{border:2px solid #D8D8D8;border-radius:5px;display:table;height:inherit;width:100%}div.tree-multiselect>div.selected,div.tree-multiselect>div.selections{display:inline-block;box-sizing:border-box;overflow:auto;padding:1%;vertical-align:top;width:50%}div.tree-multiselect>div.selections{border-right:solid 2px #D8D8D8}div.tree-multiselect>div.selections div.item{margin-left:16px}div.tree-multiselect>div.selections div.item label{cursor:pointer;display:inline}div.tree-multiselect>div.selections div.item label.disabled{color:#D8D8D8}div.tree-multiselect>div.selections.no-border{border-right:none}div.tree-multiselect>div.selected>div.item{background:#EAEAEA;border-radius:2px;padding:2px 5px;overflow:auto}div.tree-multiselect>div.selected.ui-sortable>div.item:hover{cursor:move}div.tree-multiselect div.section>div.section,div.tree-multiselect div.section>div.item{padding-left:20px}div.tree-multiselect div.section.collapsed>div.title span.collapse-section:after{content:"+"}div.tree-multiselect div.section.collapsed:not([searchhit])>.item,div.tree-multiselect div.section.collapsed:not([searchhit])>.section{display:none}div.tree-multiselect div.title,div.tree-multiselect div.item{margin-bottom:2px}div.tree-multiselect div.title{background:#777;color:white;padding:2px}div.tree-multiselect div.title>*{display:inline-block}div.tree-multiselect div.title>span.collapse-section{margin:0 3px;width:8px}div.tree-multiselect div.title>span.collapse-section:after{content:"-"}div.tree-multiselect div.title:hover{cursor:pointer}div.tree-multiselect input[type=checkbox]{display:inline;margin-right:5px}div.tree-multiselect input[type=checkbox]:not([disabled]):hover{cursor:pointer}div.tree-multiselect span.remove-selected,div.tree-multiselect span.description{background:#777;border-radius:2px;color:white;margin-right:5px;padding:0 3px}div.tree-multiselect span.remove-selected:hover{cursor:pointer}div.tree-multiselect span.description:hover{cursor:help}div.tree-multiselect div.temp-description-popup{background:#EAEAEA;border:2px solid #676767;border-radius:3px;padding:5px}div.tree-multiselect span.section-name{float:right;font-style:italic}div.tree-multiselect .auxiliary{display:table;width:100%}div.tree-multiselect .auxiliary input.search{border:2px solid #D8D8D8;display:table-cell;margin:0;padding:5px;width:100%}div.tree-multiselect .auxiliary .select-all-container{display:table-cell;text-align:right}div.tree-multiselect .auxiliary .select-all-container span.select-all,div.tree-multiselect .auxiliary .select-all-container span.unselect-all{margin-right:5px;padding-right:5px}div.tree-multiselect .auxiliary .select-all-container span.select-all:hover,div.tree-multiselect .auxiliary .select-all-container span.unselect-all:hover{cursor:pointer}div.tree-multiselect .auxiliary .select-all-container span.select-all{border-right:2px solid #D8D8D8} diff --git a/dist/jquery.tree-multiselect.min.js b/dist/jquery.tree-multiselect.min.js index 74eedc7..8c3fc28 100644 --- a/dist/jquery.tree-multiselect.min.js +++ b/dist/jquery.tree-multiselect.min.js @@ -1,2 +1,2 @@ -/* jQuery Tree Multiselect v2.4.0 | (c) Patrick Tsai | MIT Licensed */ +/* jQuery Tree Multiselect v2.4.1 | (c) Patrick Tsai | MIT Licensed */ !function e(t,i,s){function n(a,o){if(!i[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[a]={exports:{}};t[a][0].call(d.exports,function(e){var i=t[a][1][e];return n(i||e)},d,d.exports,e,t,i,s)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a0?c.split(n.params.sectionDelimiter):[],h=0;h span.description",function(){var e=jQuery(this).parent(),t=e.attr("data-description"),i=document.createElement("div");i.className="temp-description-popup",i.innerHTML=t,i.style.position="absolute",e.append(i)}),this.$selectionContainer.on("mouseleave","div.item > span.description",function(){jQuery(this).parent().find("div.temp-description-popup").remove()})},n.prototype.handleSectionCheckboxMarkings=function(){var e=this;this.$selectionContainer.on("click","input.section[type=checkbox]",function(){var t=jQuery(this).closest("div.section").find("div.item").map(function(t,i){var s=c.getKey(i);if(!e.astItems[s].disabled)return s}).get();if(this.checked){var i;(i=e.keysToAdd).push.apply(i,s(t)),c.array.uniq(e.keysToAdd)}else{var n;(n=e.keysToRemove).push.apply(n,s(t)),c.array.uniq(e.keysToRemove)}e.render()})},n.prototype.redrawSectionCheckboxes=function(e){var t=3,i=this;if((e=e||this.$selectionContainer).find("> div.section").each(function(){var e=i.redrawSectionCheckboxes(jQuery(this));t&=e}),t)for(var s=e.find("> div.item > input[type=checkbox]"),n=0;n div.title > input[type=checkbox]");return r.length&&(r=r[0],1&t?(r.checked=!0,r.indeterminate=!1):2&t?(r.checked=!1,r.indeterminate=!1):(r.checked=!1,r.indeterminate=!0)),t},n.prototype.addCollapsibility=function(){var e=this.$selectionContainer.find("div.title"),t=c.dom.createNode("span",{class:"collapse-section"});e.prepend(t);var i=this.$selectionContainer.find("div.section");this.params.startCollapsed&&i.addClass("collapsed"),this.$selectionContainer.on("click","div.title",function(e){"INPUT"!==e.target.nodeName&&(jQuery(this).parent().toggleClass("collapsed"),e.stopPropagation())})},n.prototype.createSearchBar=function(e){var t=new a(this.astItems,this.astSections,this.params.searchParams),i=c.dom.createNode("input",{class:"search",placeholder:"Search..."});e.appendChild(i),this.$selectionContainer.on("input","input.search",function(){var e=this.value;t.search(e)})},n.prototype.createSelectAllButtons=function(e){var t=c.dom.createNode("span",{class:"select-all",text:this.params.selectAllText}),i=c.dom.createNode("span",{class:"unselect-all",text:this.params.unselectAllText}),n=c.dom.createNode("div",{class:"select-all-container"});n.appendChild(t),n.appendChild(i),e.appendChild(n);var r=this;this.$selectionContainer.on("click","span.select-all",function(){r.keysToAdd=Object.keys(r.astItems),r.render()}),this.$selectionContainer.on("click","span.unselect-all",function(){var e;(e=r.keysToRemove).push.apply(e,s(r.selectedKeys)),r.render()})},n.prototype.armRemoveSelectedOnClick=function(){var e=this;this.$selectedContainer.on("click","span.remove-selected",function(){var t=this.parentNode,i=c.getKey(t);e.keysToRemove.push(i),e.render()})},n.prototype.updateSelectedAndOnChange=function(){var e=this;if(this.$selectionContainer.on("click","input.option[type=checkbox]",function(){var t=this,i=t.parentNode,s=c.getKey(i);c.assert(s||0===s),t.checked?e.keysToAdd.push(s):e.keysToRemove.push(s),e.render()}),this.params.sortable&&!this.params.freeze){var t=null,i=null;this.$selectedContainer.sortable({start:function(e,i){t=i.item.index()},stop:function(s,n){i=n.item.index(),t!==i&&(c.array.moveEl(e.selectedKeys,t,i),e.render())}})}},n.prototype.render=function(e){var t,i=this;c.array.uniq(this.keysToAdd),c.array.uniq(this.keysToRemove),c.array.subtract(this.keysToAdd,this.selectedKeys),c.array.intersect(this.keysToRemove,this.selectedKeys);for(var n=0;n'),s=jQuery('
');t&&s.addClass("no-border"),i.append(s);var n=jQuery('
');t||i.append(n),this.$el=e,this.$treeContainer=i,this.$selectionContainer=s,this.$selectedContainer=n}s.prototype.attach=function(){this.$el.after(this.$treeContainer)},s.prototype.remove=function(){this.$treeContainer.remove()},t.exports=s},{}],7:[function(e,t,i){"use strict";function s(e,t){for(var i=0,s=0;s0&&t[0]<=i[0];++t[0]){for(var n=!1,r=1;ri[r]){n=!0;break}}if(n)break;for(var a=!0,o=1;o