mirror of
/repos/Prototyper.git
synced 2025-12-30 06:31:32 +01:00
update navigation viewModel
This commit is contained in:
parent
772df77030
commit
066ac3094e
@ -424,11 +424,21 @@ function updateViewModelMain(app, viewModel, doc, vm_config) {
|
||||
addComputed(snapshot);
|
||||
debug && console.log('updating viewModel', snapshot, viewModel, vm_config);
|
||||
ko.mapping.fromJS(snapshot, vm_config.mapping, viewModel);
|
||||
viewModel._newAttribute("");
|
||||
debug && console.log('updated viewModel', viewModel);
|
||||
viewModel._newAttribute("");
|
||||
mainViewModelUpdating = false;
|
||||
}
|
||||
|
||||
var navigationViewModelUpdating = false;
|
||||
function updateViewModelNavigation(app, viewModel, doc, vm_config) {
|
||||
navigationViewModelUpdating = true;
|
||||
var snapshot = doc.snapshot;
|
||||
debug && console.log('updating viewModel', snapshot, viewModel, vm_config);
|
||||
ko.mapping.fromJS(snapshot, vm_config.mapping, viewModel);
|
||||
debug && console.log('updated viewModel', viewModel);
|
||||
navigationViewModelUpdating = false;
|
||||
}
|
||||
|
||||
|
||||
/* crazy expensive caching tree traverse */
|
||||
function traverse(current, field, property, depth, pos) {
|
||||
@ -491,7 +501,7 @@ function updateViewModel(app, viewModels, key, doc, vm_config) {
|
||||
updateViewModelMain(app, viewModels[key], doc, vm_config);
|
||||
}
|
||||
if (key == 'navigation') {
|
||||
// updateViewModelMain(app, viewModels[key], doc, mapping);
|
||||
updateViewModelNavigation(app, viewModels[key], doc, vm_config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"default_icon": "icon-eye-open",
|
||||
"default_icon": "icon-home",
|
||||
"links": [
|
||||
{
|
||||
"title": "Prototyper",
|
||||
@ -70,7 +70,8 @@
|
||||
},
|
||||
{
|
||||
"title": "Documentation",
|
||||
"url": "http://knockoutjs.com/documentation/introduction.html"
|
||||
"url": "http://knockoutjs.com/documentation/introduction.html",
|
||||
"icon_class": "icon-book"
|
||||
},
|
||||
{
|
||||
"title": "Mapping Plugin",
|
||||
@ -92,7 +93,8 @@
|
||||
},
|
||||
{
|
||||
"title": "Underscore",
|
||||
"url": "http://underscorejs.org/"
|
||||
"url": "http://underscorejs.org/",
|
||||
"icon_class": "icon-home"
|
||||
},
|
||||
{
|
||||
"title": "ACE",
|
||||
@ -113,7 +115,8 @@
|
||||
},
|
||||
{
|
||||
"title": "API",
|
||||
"url": "http://nodejs.org/api/"
|
||||
"url": "http://nodejs.org/api/",
|
||||
"icon_class": "icon-book"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -127,7 +130,8 @@
|
||||
},
|
||||
{
|
||||
"title": "API",
|
||||
"url": "http://expressjs.com/api.html"
|
||||
"url": "http://expressjs.com/api.html",
|
||||
"icon_class": "icon-book"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -136,17 +140,20 @@
|
||||
"links": [
|
||||
{
|
||||
"title": "MongoDB Manual",
|
||||
"url": "http://docs.mongodb.org/manual/contents/"
|
||||
"url": "http://docs.mongodb.org/manual/contents/",
|
||||
"icon_class": "icon-book"
|
||||
},
|
||||
{
|
||||
"title": "MongoDB Node.JS Driver",
|
||||
"url": "http://mongodb.github.io/node-mongodb-native/contents.html"
|
||||
"url": "http://mongodb.github.io/node-mongodb-native/contents.html",
|
||||
"icon_class": "icon-book"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "ShareJS",
|
||||
"url": "https://github.com/josephg/ShareJS/wiki"
|
||||
"url": "https://github.com/josephg/ShareJS/wiki",
|
||||
"icon_class": "icon-book"
|
||||
},
|
||||
{
|
||||
"title": "Underscore",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user