Browse Source

Merge branch 'master' of http://cloud.finedevelop.com:2015/scm/~guy/fineui

# Conflicts:
#	dist/bundle.js
#	dist/fineui.js
es6
guy 6 years ago
parent
commit
1261abf77a
  1. 19
      dist/bundle.js
  2. 66
      dist/bundle.min.js
  3. 37
      dist/core.js
  4. 19
      dist/fineui.js
  5. 66
      dist/fineui.min.js
  6. 29
      dist/fix/fix.compact.js
  7. 2
      dist/utils.min.js
  8. 37
      src/core/widget.js

19
dist/bundle.js vendored

@ -21346,10 +21346,10 @@ _.extend(BI.OB.prototype, {
*/ */
!(function () { !(function () {
var lazy = (typeof document !== "undefined" && var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === "number") || typeof document.documentMode === 'number') ||
(typeof navigator !== "undefined" && (typeof navigator !== 'undefined' &&
typeof navigator.userAgent === "string" && typeof navigator.userAgent === 'string' &&
/\bEdge\/\d/.test(navigator.userAgent)); /\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, { BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () { _defaultConfig: function () {
@ -21399,7 +21399,6 @@ _.extend(BI.OB.prototype, {
this._initVisual(); this._initVisual();
this._initState(); this._initState();
if (this.isVisible()) { if (this.isVisible()) {
this.rendered = true;
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -21409,9 +21408,10 @@ _.extend(BI.OB.prototype, {
} else { } else {
this._render(); this._render();
} }
this.rendered = true
} }
if (this._isRoot) { if (this._isRoot) {
this._mount(); this._mount()
} }
}, },
@ -21535,7 +21535,7 @@ _.extend(BI.OB.prototype, {
if (!isMounted) { if (!isMounted) {
return; return;
} }
this._isMounting = true; this._isMounting = true
if (!this.rendered) { if (!this.rendered) {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
@ -21558,7 +21558,7 @@ _.extend(BI.OB.prototype, {
}); });
lazy && this._mountChildren && this._mountChildren(); lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted(); this.mounted && this.mounted();
this._isMounting = false; this._isMounting = false
}, },
_mountChildren: null, _mountChildren: null,
@ -21835,8 +21835,7 @@ _.extend(BI.OB.prototype, {
this.purgeListeners(); this.purgeListeners();
} }
}); });
})(); })();(function () {
(function () {
var kv = {}; var kv = {};
BI.shortcut = function (xtype, cls) { BI.shortcut = function (xtype, cls) {
if (kv[xtype] != null) { if (kv[xtype] != null) {

66
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

37
dist/core.js vendored

@ -21344,7 +21344,14 @@ _.extend(BI.OB.prototype, {
* *
* @cfg {JSON} options 配置属性 * @cfg {JSON} options 配置属性
*/ */
BI.Widget = BI.inherit(BI.OB, {
!(function () {
var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === 'number') ||
(typeof navigator !== 'undefined' &&
typeof navigator.userAgent === 'string' &&
/\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
root: false, root: false,
@ -21391,6 +21398,7 @@ BI.Widget = BI.inherit(BI.OB, {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
if (this.isVisible()) {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -21400,6 +21408,11 @@ BI.Widget = BI.inherit(BI.OB, {
} else { } else {
this._render(); this._render();
} }
this.rendered = true
}
if (this._isRoot) {
this._mount()
}
}, },
_render: function () { _render: function () {
@ -21511,7 +21524,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () { _mount: function () {
var self = this; var self = this;
var isMounted = this._isMounted; var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) { if (this._isMounting || isMounted || !this.isVisible() || this.__asking === true) {
return; return;
} }
if (this._isRoot === true) { if (this._isRoot === true) {
@ -21522,15 +21535,30 @@ BI.Widget = BI.inherit(BI.OB, {
if (!isMounted) { if (!isMounted) {
return; return;
} }
this._isMounting = true
if (!this.rendered) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
}
}
this.beforeMount && this.beforeMount(); this.beforeMount && this.beforeMount();
this._isMounted = true; this._isMounted = true;
this._mountChildren && this._mountChildren(); !lazy && this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) { BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false); !self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false); !self.isValid() && widget._setValid(false);
widget._mount && widget._mount(); widget._mount && widget._mount();
}); });
lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted(); this.mounted && this.mounted();
this._isMounting = false
}, },
_mountChildren: null, _mountChildren: null,
@ -21806,7 +21834,8 @@ BI.Widget = BI.inherit(BI.OB, {
this._purgeRef(); this._purgeRef();
this.purgeListeners(); this.purgeListeners();
} }
});(function () { });
})();(function () {
var kv = {}; var kv = {};
BI.shortcut = function (xtype, cls) { BI.shortcut = function (xtype, cls) {
if (kv[xtype] != null) { if (kv[xtype] != null) {

19
dist/fineui.js vendored

@ -21567,10 +21567,10 @@ _.extend(BI.OB.prototype, {
*/ */
!(function () { !(function () {
var lazy = (typeof document !== "undefined" && var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === "number") || typeof document.documentMode === 'number') ||
(typeof navigator !== "undefined" && (typeof navigator !== 'undefined' &&
typeof navigator.userAgent === "string" && typeof navigator.userAgent === 'string' &&
/\bEdge\/\d/.test(navigator.userAgent)); /\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, { BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () { _defaultConfig: function () {
@ -21620,7 +21620,6 @@ _.extend(BI.OB.prototype, {
this._initVisual(); this._initVisual();
this._initState(); this._initState();
if (this.isVisible()) { if (this.isVisible()) {
this.rendered = true;
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -21630,9 +21629,10 @@ _.extend(BI.OB.prototype, {
} else { } else {
this._render(); this._render();
} }
this.rendered = true
} }
if (this._isRoot) { if (this._isRoot) {
this._mount(); this._mount()
} }
}, },
@ -21756,7 +21756,7 @@ _.extend(BI.OB.prototype, {
if (!isMounted) { if (!isMounted) {
return; return;
} }
this._isMounting = true; this._isMounting = true
if (!this.rendered) { if (!this.rendered) {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
@ -21779,7 +21779,7 @@ _.extend(BI.OB.prototype, {
}); });
lazy && this._mountChildren && this._mountChildren(); lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted(); this.mounted && this.mounted();
this._isMounting = false; this._isMounting = false
}, },
_mountChildren: null, _mountChildren: null,
@ -22056,8 +22056,7 @@ _.extend(BI.OB.prototype, {
this.purgeListeners(); this.purgeListeners();
} }
}); });
})(); })();(function () {
(function () {
var kv = {}; var kv = {};
BI.shortcut = function (xtype, cls) { BI.shortcut = function (xtype, cls) {
if (kv[xtype] != null) { if (kv[xtype] != null) {

66
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

29
dist/fix/fix.compact.js vendored

@ -1,5 +1,5 @@
;(function () { ;(function () {
function initWatch (vm, watch) { function initWatch(vm, watch) {
vm._watchers || (vm._watchers = []); vm._watchers || (vm._watchers = []);
for (var key in watch) { for (var key in watch) {
var handler = watch[key]; var handler = watch[key];
@ -13,7 +13,7 @@
} }
} }
function createWatcher (vm, keyOrFn, handler) { function createWatcher(vm, keyOrFn, handler) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), { return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), {
store: vm.store store: vm.store
}); });
@ -22,24 +22,24 @@
var target = null; var target = null;
var targetStack = []; var targetStack = [];
function pushTarget (_target) { function pushTarget(_target) {
if (target) targetStack.push(target); if (target) targetStack.push(target);
Fix.Model.target = target = _target; Fix.Model.target = target = _target;
} }
function popTarget () { function popTarget() {
Fix.Model.target = target = targetStack.pop(); Fix.Model.target = target = targetStack.pop();
} }
var context = null; var context = null;
var contextStack = []; var contextStack = [];
function pushContext (_context) { function pushContext(_context) {
if (context) contextStack.push(context); if (context) contextStack.push(context);
Fix.Model.context = context = _context; Fix.Model.context = context = _context;
} }
function popContext () { function popContext() {
Fix.Model.context = context = contextStack.pop(); Fix.Model.context = context = contextStack.pop();
} }
@ -60,7 +60,7 @@
}, options); }, options);
}; };
function findStore (widget) { function findStore(widget) {
if (target != null) { if (target != null) {
return target; return target;
} }
@ -106,12 +106,11 @@
}; };
}); });
var _init = BI.Widget.prototype._init; function createStore() {
BI.Widget.prototype._init = function () {
var self = this;
var needPop = false; var needPop = false;
if (window.Fix && this._store) { if (!this._storeCreated && window.Fix && this._store && this.isVisible()) {
var store = findStore(this.options.context || this.options.element); var store = findStore(this.options.context || this.options.element);
this._storeCreated = true;
if (store) { if (store) {
pushTarget(store); pushTarget(store);
needPop = true; needPop = true;
@ -128,6 +127,13 @@
} }
needPop = true; needPop = true;
} }
return needPop;
}
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var self = this;
var needPop = createStore.call(this);
_init.apply(this, arguments); _init.apply(this, arguments);
needPop && popTarget(); needPop && popTarget();
}; };
@ -166,6 +172,7 @@
_.each(["_mount"], function (name) { _.each(["_mount"], function (name) {
var old = BI.Widget.prototype[name]; var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () { old && (BI.Widget.prototype[name] = function () {
createStore.call(this);
this.store && pushTarget(this.store); this.store && pushTarget(this.store);
var res = old.apply(this, arguments); var res = old.apply(this, arguments);
this.store && popTarget(); this.store && popTarget();

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

37
src/core/widget.js

@ -5,7 +5,14 @@
* *
* @cfg {JSON} options 配置属性 * @cfg {JSON} options 配置属性
*/ */
BI.Widget = BI.inherit(BI.OB, {
!(function () {
var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === 'number') ||
(typeof navigator !== 'undefined' &&
typeof navigator.userAgent === 'string' &&
/\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
root: false, root: false,
@ -52,6 +59,7 @@ BI.Widget = BI.inherit(BI.OB, {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
if (this.isVisible()) {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -61,6 +69,11 @@ BI.Widget = BI.inherit(BI.OB, {
} else { } else {
this._render(); this._render();
} }
this.rendered = true
}
if (this._isRoot) {
this._mount()
}
}, },
_render: function () { _render: function () {
@ -172,7 +185,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () { _mount: function () {
var self = this; var self = this;
var isMounted = this._isMounted; var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) { if (this._isMounting || isMounted || !this.isVisible() || this.__asking === true) {
return; return;
} }
if (this._isRoot === true) { if (this._isRoot === true) {
@ -183,15 +196,30 @@ BI.Widget = BI.inherit(BI.OB, {
if (!isMounted) { if (!isMounted) {
return; return;
} }
this._isMounting = true
if (!this.rendered) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
}
}
this.beforeMount && this.beforeMount(); this.beforeMount && this.beforeMount();
this._isMounted = true; this._isMounted = true;
this._mountChildren && this._mountChildren(); !lazy && this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) { BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false); !self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false); !self.isValid() && widget._setValid(false);
widget._mount && widget._mount(); widget._mount && widget._mount();
}); });
lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted(); this.mounted && this.mounted();
this._isMounting = false
}, },
_mountChildren: null, _mountChildren: null,
@ -467,4 +495,5 @@ BI.Widget = BI.inherit(BI.OB, {
this._purgeRef(); this._purgeRef();
this.purgeListeners(); this.purgeListeners();
} }
}); });
})();
Loading…
Cancel
Save