Browse Source

优化一下context的传递

es6
guy 4 years ago
parent
commit
8fed6e639d
  1. 4
      dist/fix/fix.compact.ie.js
  2. 4
      dist/fix/fix.compact.js

4
dist/fix/fix.compact.ie.js vendored

@ -82,7 +82,7 @@
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
break; break;
} }
p = p._context || p._parent || (p.options && p.options.element); p = p._parent || (p.options && p.options.element) || p._context;
} }
if (p) { if (p) {
if (p instanceof Fix.Model) { if (p instanceof Fix.Model) {
@ -106,7 +106,7 @@
function createStore () { function createStore () {
var needPop = false; var needPop = false;
if (_global.Fix && this._store) { if (_global.Fix && this._store) {
var store = findStore(this.options.context || this._context || this._parent || this.options.element); var store = findStore(this.options.context || this._parent || this.options.element || this._context);
if (store) { if (store) {
pushTarget(store); pushTarget(store);
needPop = true; needPop = true;

4
dist/fix/fix.compact.js vendored

@ -86,7 +86,7 @@
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
break; break;
} }
p = p._context || p._parent || (p.options && p.options.element); p = p._parent || (p.options && p.options.element) || p._context;
} }
if (p) { if (p) {
if (p instanceof Fix.Model) { if (p instanceof Fix.Model) {
@ -114,7 +114,7 @@
function createStore () { function createStore () {
var needPop = false; var needPop = false;
if (_global.Fix && this._store) { if (_global.Fix && this._store) {
var store = findStore(this.options.context || this._context || this._parent || this.options.element); var store = findStore(this.options.context || this._parent || this.options.element || this._context);
if (store) { if (store) {
pushTarget(store); pushTarget(store);
needPop = true; needPop = true;

Loading…
Cancel
Save