zoukankan      html  css  js  c++  java
  • 重构artDialog.prompt方法,让它支持多行文本

      artDialog.prompt = function (content, yes, value) {
                value = value || '';
                var input;

                return artDialog({
                    id: 'Prompt',
                    icon: 'question',
                    fixed: true,
                    lock: true,
                    opacity: .1,
                    content: [
                '<div style="margin-bottom:5px;font-size:12px">',
                    content,
                '</div>',
                '<div>',
                    '<textarea cols=30 rows=5>' + value + '</textarea>',
                '</div>'
                ].join(''),
                    init: function () {
                        input = this.DOM.content.find('textarea')[0];
                        input.select();
                        input.focus();
                    },
                    ok: function (here) {
                        return yes && yes.call(this, input.value, here);
                    },
                    cancel: true
                });
            };

           // 调用
            artDialog.prompt("ok", function (data) { alert(data); }, "ok1");

  • 相关阅读:
    js截取字符串区分汉字字母代码
    List 去处自定义重复对象方法
    63. Unique Paths II
    62. Unique Paths
    388. Longest Absolute File Path
    41. First Missing Positive
    140. Word Break II
    139. Word Break
    239. Sliding Window Maximum
    5. Longest Palindromic Substring
  • 原文地址:https://www.cnblogs.com/lori/p/2350941.html
Copyright © 2011-2022 走看看