|
@@ -270,17 +270,27 @@ |
|
@@ -270,17 +270,27 @@ |
270
|
// });
|
270
|
// });
|
271
|
|
271
|
|
272
|
/*字数限制*/
|
272
|
/*字数限制*/
|
273
|
- $("#content").on("keydown keyup mousedown change", function() {
|
273
|
+ // $("#content").emojioneArea().on("keypress", function() {
|
|
|
274
|
+ // debugger
|
|
|
275
|
+ // var $this = $(this);
|
|
|
276
|
+ // var count = $this.val().length;
|
|
|
277
|
+ // if(count>500){
|
|
|
278
|
+ // $.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
|
|
|
279
|
+ // }
|
|
|
280
|
+ // $("#content-count").text(count);
|
|
|
281
|
+ // });
|
|
|
282
|
+ $("#content").emojioneArea()[0].emojioneArea.on("keyup change",function (edite,event) {
|
274
|
debugger
|
283
|
debugger
|
275
|
var $this = $(this);
|
284
|
var $this = $(this);
|
276
|
- var count = $this.val().length;
|
285
|
+ var count = $this[0].getText().length;
|
|
|
286
|
+ var content = $this[0].getText();
|
277
|
if(count>500){
|
287
|
if(count>500){
|
278
|
- $.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
|
288
|
+ $this[0].setText(content.substring(0,500));
|
|
|
289
|
+ count = $this[0].getText().length;
|
279
|
}
|
290
|
}
|
280
|
$("#content-count").text(count);
|
291
|
$("#content-count").text(count);
|
281
|
});
|
292
|
});
|
282
|
|
293
|
|
283
|
-
|
|
|
284
|
$("#labelId").combobox({
|
294
|
$("#labelId").combobox({
|
285
|
prompt: "请选择标签",
|
295
|
prompt: "请选择标签",
|
286
|
required: false,
|
296
|
required: false,
|