diff --git a/CHANGES.md b/CHANGES.md index 0f5e2f63c96441782bbe8f78c9d4fe09f10bbb2c..ba4ea7de7f8001b8f5e07e247a6f6731b374870d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -69,6 +69,8 @@ ZUI 官方网站为 https://www.openzui.com/ ,并提供了[英文文档(https: * 加载指示器: * 优化了与按钮一起使用时的样式; * 优化了覆盖层的样式,减少了透明度; +* 颜色选择器: + * 修复了下拉菜单宽度问题; * 文件上传: * 优化了对远程服务器返回的 JSON 内容容错性,如果返回的 JSON 对象中没有指定 `status` 或 `result` 属性仍然视为上传成功; * 修复了对 IE 浏览器的兼容; diff --git a/en/CHANGES.md b/en/CHANGES.md index 01de925d6028628a61af8c12d9b4f6a8d792d003..e3bce9e73bc749559abb418b810bb8018b2c7c77 100644 --- a/en/CHANGES.md +++ b/en/CHANGES.md @@ -70,6 +70,8 @@ ZUI official website is https://www.openzui.com/ and English version is availabl * Load indicator * Optimized the style used with icons. * Optimized the style of the overlay and reduced the opacity. +* Color picker + * Fixed dropdown menu width. * Uploader * Optimized the fault tolerance of JSON content called back by a remote server. It is deemed as uploaded, if no specified `status` or `result` in JSON. * Fixed the IE browser compatibility. diff --git a/src/js/colorpicker.js b/src/js/colorpicker.js index 82574448e3de56e71e0db9d238579d71cd0672eb..b4a1558df9f90c8ba29d98264d8eff5b0cccf16d 100644 --- a/src/js/colorpicker.js +++ b/src/js/colorpicker.js @@ -120,12 +120,12 @@ }; ColorPicker.prototype.updateColors = function(colors) { - var $picker = this.$picker, - $menu = this.$menu.children('li:not(.heading)').remove(), + var $menu = this.$menu, options = this.options, - colors = colors || this.colors, - that = this; + colors = colors || this.colors, + that = this; var bestLineCount = 0; + $menu.children('li:not(.heading)').remove(); $.each(colors, function(idx, color) { that.addColor(color); bestLineCount++; @@ -139,11 +139,11 @@ }; ColorPicker.prototype.setValue = function(color, notSetInput) { - var that = this; + var that = this; var options = that.options; - var $btn = that.$btn; + var $btn = that.$btn; + var hex = ''; that.$menu.find('.cp-tile.active').removeClass('active'); - var hex = ''; var updateBtn = options.updateBtn; if (updateBtn === 'auto') { var $btnBar = $btn.find('.color-bar');