zui.migrate.1.2.js 1.3 KB
Newer Older
C
Catouse 已提交
1 2 3 4 5
/* ========================================================================
 * ZUI: zui.migrate.1.2.js
 * This file inclues some helper methods to help upgrad version 1.2 or
 * lower to version 1.3
 * If you are using 1.3+, then ignore this.
C
Catouse 已提交
6
 * http://openzui.com
C
Catouse 已提交
7
 * ========================================================================
C
Catouse 已提交
8
 * Copyright 2014-2020 cnezsoft.com; Licensed MIT
C
Catouse 已提交
9 10 11
 * ======================================================================== */


C
Catouse 已提交
12
(function($, window) {
C
Catouse 已提交
13
    var zui = $.zui;
C
Catouse 已提交
14 15 16 17
    if(zui) {
        function extendTo(name, target) {
            if($.isArray(name)) {
                $.each(name, function(i, n) {
C
Catouse 已提交
18
                    extendTo(n, target);
C
Catouse 已提交
19 20 21 22
                });
                return;
            }

C
Catouse 已提交
23 24 25
            var config = {};
            config[name] = zui[name];

C
Catouse 已提交
26
            if(target) {
C
Catouse 已提交
27
                $.extend(target, config);
C
Catouse 已提交
28
            } else {
C
Catouse 已提交
29
                $.extend(config);
C
Catouse 已提交
30 31 32 33
            }
        }

        extendTo(['uuid', 'callEvent', 'clientLang', 'browser', 'messager', 'Messager', 'showMessager', 'closeModal', 'ajustModalPosition', 'ModalTrigger', 'modalTrigger', 'store']);
C
Catouse 已提交
34
        extendTo(['Color', 'imgReady', 'messager', 'Messager', 'showMessager', 'closeModal', 'ajustModalPosition', 'ModalTrigger', 'modalTrigger', 'store'], window);
C
Catouse 已提交
35 36
    }
}(jQuery, window));