Fix errors on loading saved freeboard

pull/39/head
Kyle Campbell 2014-07-01 01:45:01 -04:00
parent 4d0c49596f
commit a0f205941b
2 changed files with 12 additions and 6 deletions

View File

@ -151,13 +151,13 @@ function FreeboardModel(datasourcePlugins, widgetPlugins, freeboardUI)
var sortedPanes = _.sortBy(object.panes, function(pane){
return getPositionForScreenSize(pane).row;
return freeboard._getPositionForScreenSize(pane).row;
});
_.each(sortedPanes, function(paneConfig)
{
var pane = new PaneModel();
var pane = new PaneModel(self, widgetPlugins);
pane.deserialize(paneConfig);
self.panes.push(pane);
});
@ -195,7 +195,7 @@ function FreeboardModel(datasourcePlugins, widgetPlugins, freeboardUI)
this.clearDashboard = function()
{
grid._removeAllWidgets();
freeboard._removeAllWidgets();
_.each(self.datasources(), function(datasource)
{

View File

@ -714,17 +714,23 @@ var freeboard = (function()
{
developerConsole.showDeveloperConsole();
},
// Temporary measures for FreeboardModel; move these to FreeboardUI.
_removeAllWidgets : function()
{
grid.remove_all_widgets();
grid.remove_all_widgets();
},
_disableGrid : function()
{
grid.disable();
grid.disable();
},
_enableGrid : function()
{
grid.enable();
grid.enable();
},
_getPositionForScreenSize : function(paneModel)
{
return getPositionForScreenSize(paneModel);
}
};
}());