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");

  • 相关阅读:
    产品经理经常犯的错误李可按
    skills_hive
    skills_office
    skills_idea
    skills_linux
    skills_ubuntu
    skills_git
    skills_redis
    skills_centos
    problems_hive
  • 原文地址:https://www.cnblogs.com/lori/p/2350941.html
Copyright © 2011-2022 走看看