Skip to content

Commit

Permalink
allow fillIn as well as mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddulak committed Nov 30, 2015
1 parent 4d65c68 commit 37356fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/mvc/ChildViewManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ define(function(require) {
Disposable = require('lavaca/util/Disposable'),
contains = require('mout/array/contains'),
merge = require('mout/object/merge'),
fillIn = require('mout/object/fillIn'),
History = require('lavaca/net/History'),
removeAll = require('mout/array/removeAll');

Expand Down Expand Up @@ -97,6 +98,9 @@ define(function(require) {
if (typeof this.childViewMixin === 'object') {
merge(childView, this.childViewMixin);
}
if (typeof this.childViewfillin === 'object') {
fillIn(childView, this.childViewFillin);
}
if (typeof params === 'object') {
merge(childView, params);
}
Expand Down
5 changes: 4 additions & 1 deletion src/mvc/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,14 @@ define(function(require) {
* The map should be in the form {selector: {TView : TView, model : lavaca.mvc.Model, step: Int}}. For example, {'form': {TView : ExampleView, model : new Model(), step: 1}}
*
*/
mapChildViewManager:function(el, map, mixin){
mapChildViewManager:function(el, map, mixin, fillin){
this.childViewManager = new ChildViewManager(el, map, this);
if (typeof mixin === 'object') {
this.childViewManager.childViewMixin = mixin;
}
if (typeof fillin === 'object') {
this.childViewManager.childViewFillin = fillin;
}
},

/**
Expand Down
4 changes: 4 additions & 0 deletions src/mvc/ViewManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ define(function(require) {
Cache = require('lavaca/util/Cache'),
Disposable = require('lavaca/util/Disposable'),
merge = require('mout/object/merge'),
fillIn = require('mout/object/fillIn'),
contains = require('mout/array/contains'),
removeAll = require('mout/array/removeAll');

Expand Down Expand Up @@ -115,6 +116,9 @@ define(function(require) {
if (typeof this.pageViewMixin === 'object') {
merge(pageView, this.pageViewMixin);
}
if (typeof this.pageViewFillin === 'object') {
fillIn(pageView, this.pageViewFillin);
}
if (typeof params === 'object') {
merge(pageView, params);
}
Expand Down

0 comments on commit 37356fd

Please sign in to comment.