浏览代码

调整tags插件

笔下光年 5 年之前
父节点
当前提交
a922eb5acf
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 1 1
      README.md
  2. 6 5
      js/main.min.js
  3. 1 1
      lyear_js_tags_input.html

+ 1 - 1
README.md

@@ -104,7 +104,7 @@
 - perfect-scrollbar
 
 ### 更新记录
-2020.06.14 新增通用样式,调整复选框单选框换行后左侧空白问题
+2020.06.14 新增通用样式,调整复选框单选框换行后左侧空白问题,调整tags插件
 
 2020.06.14 新增label样式,调整datepicker插件样式和使用,调整silders插件样式和皮肤,改td垂直居中,增加登录页面
 

+ 6 - 5
js/main.min.js

@@ -82,15 +82,16 @@ jQuery( function() {
     }
     
     // 标签
-	if($('.js-tags-input')[0]) {
-		$('.js-tags-input').tagsInput({
-			height: '36px',
+	$('.js-tags-input').each(function() {
+        var $this = $(this);
+        $this.tagsInput({
+			height: $this.data('height') ? $this.data('height') : '38px',
 			width: '100%',
-			defaultText: $('.js-tags-input').attr("placeholder"),
+			defaultText: $this.attr("placeholder"),
 			removeWithBackspace: true,
 			delimiter: [',']
 		});
-	}
+    });
     
     // 时间选择
 	jQuery('.js-datetimepicker').each(function() {

+ 1 - 1
lyear_js_tags_input.html

@@ -272,7 +272,7 @@
               <div class="card-header"><h4>标签插件</h4></div>
               <div class="card-body">
                 
-                <input class="form-control js-tags-input" type="text" id="example-tags" name="tags" placeholder="请输入标签" value="光年,黄金瞳">
+                <input class="form-control js-tags-input" type="text" id="example-tags" name="tags" data-height="38px" placeholder="请输入标签" value="光年,黄金瞳">
        
               </div>
             </div>