/*! amazeui-dialog v0.0.2 | by Amaze UI Team | (c) 2016 AllMobilize, Inc. | Licensed under MIT | 2016-06-22T10:19:33+0800 */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o'); html.push('
'); if(options.title !== null) { html.push('
' + options.title + '
'); } html.push('
' + options.content + '
'); html.push(''); html.push('
'); html.push(''); return $(html.join('')) .appendTo('body') .modal() .on('closed.modal.amui', function() { options.onConfirm(); $(this).remove(); }); }; dialog.confirm = function(options) { options = options || {}; options.title = options.title || '提示'; options.content = options.content || '提示内容'; options.onConfirm = options.onConfirm || function() { }; options.onCancel = options.onCancel || function() { }; var html = []; html.push('
'); html.push('
'); html.push('
' + options.title + '
'); html.push('
' + options.content + '
'); html.push(''); html.push('
'); html.push('
'); return $(html.join('')).appendTo('body').modal({ onConfirm: function(e) { options.onConfirm(e); }, onCancel: function() { options.onCancel(); } }).on('closed.modal.amui', function() { $(this).remove(); }); }; dialog.loading = function(options) { options = options || {}; options.title = options.title || '正在载入...'; var html = []; html.push('
'); html.push('
'); html.push('
' + options.title + '
'); html.push('
'); html.push(''); html.push('
'); html.push('
'); html.push('
'); return $(html.join('')).appendTo('body').modal() .on('closed.modal.amui', function() { $(this).remove(); }); }; dialog.actions = function(options) { options = options || {}; options.title = options.title || '您想整咋样?'; options.items = options.items || []; options.onSelected = options.onSelected || function() { $acions.close(); }; var html = []; html.push('
'); html.push('
'); html.push('
    '); html.push('
  • ' + options.title + '
  • '); options.items.forEach(function(item, index) { html.push('
  • ' + item.content + '
  • '); }); html.push('
'); html.push('
'); html.push('
'); html.push(''); html.push('
'); html.push('
'); var $acions = $(html.join('')).appendTo('body'); $acions.find('.am-list>li').bind('click', function(e) { options.onSelected($(this).attr('index'), this); }); return { show: function() { $acions.modal('open'); }, close: function() { $acions.modal('close'); } }; }; dialog.popup = function(options) { options = options || {}; options.title = options.title || null; options.content = options.content || '正文'; options.class = options.class || ''; options.onClose = options.onClose || function() { }; var html = []; // 是否存在标题 if(options.title != null) { html.push('
'); html.push('
'); html.push('
'); html.push('

' + options.title + '

'); html.push('×'); html.push('
'); html.push('
' + options.content + '
'); } else { html.push(''); return $(html.join('')).appendTo('body').modal() .on('closed.modal.amui', function() { $(this).remove(); options.onClose(); }); }; module.exports = UI.dialog = dialog; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}]},{},[1]);