mirror of https://github.com/layui/layui
优化 colorpicker 的 `id` 属性取值优先级
parent
c9df4095f4
commit
15e23d37e5
|
@ -222,8 +222,10 @@ layui.define(['jquery', 'lay'], function(exports){
|
||||||
that.elemColorBox = elemColorBox
|
that.elemColorBox = elemColorBox
|
||||||
);
|
);
|
||||||
|
|
||||||
//初始化 id 参数
|
// 初始化 id 属性 - 优先取 options > 元素 id > 自增索引
|
||||||
options.id = ('id' in options) ? options.id : that.index;
|
options.id = 'id' in options ? options.id : (
|
||||||
|
elem.attr('id') || that.index
|
||||||
|
);
|
||||||
|
|
||||||
// 获取背景色值
|
// 获取背景色值
|
||||||
that.color = that.elemColorBox.find('.'+ PICKER_TRIG_SPAN)[0].style.background;
|
that.color = that.elemColorBox.find('.'+ PICKER_TRIG_SPAN)[0].style.background;
|
||||||
|
|
Loading…
Reference in New Issue