From 83cdb54793a58b9bc1e66d38437f777a36bddfb9 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Wed, 21 Aug 2013 13:47:59 -0400 Subject: Bug 907567 - "My Dashboard" is mostly empty when starting up in app tab --- extensions/MyDashboard/web/js/flags.js | 14 ++++++++++---- extensions/MyDashboard/web/js/query.js | 8 ++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'extensions') diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js index 1ba6bd696..3ac51acac 100644 --- a/extensions/MyDashboard/web/js/flags.js +++ b/extensions/MyDashboard/web/js/flags.js @@ -140,8 +140,7 @@ YUI({ dataTable.requestee.plug(Y.Plugin.DataTableSort); dataTable.requestee.plug(Y.Plugin.DataTableDataSource, { - datasource: dataSource, - initialRequest: updateFlagTable("requestee"), + datasource: dataSource.requestee }); dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, { @@ -185,8 +184,7 @@ YUI({ dataTable.requester.plug(Y.Plugin.DataTableSort); dataTable.requester.plug(Y.Plugin.DataTableDataSource, { - datasource: dataSource, - initialRequest: updateFlagTable("requester"), + datasource: dataSource.requester }); dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, { @@ -197,6 +195,14 @@ YUI({ } }); + // Initial load + Y.on("contentready", function (e) { + updateFlagTable("requestee"); + }, "#requestee_table"); + Y.on("contentready", function (e) { + updateFlagTable("requester"); + }, "#requester_table"); + Y.one('#requester_refresh').on('click', function(e) { updateFlagTable('requester'); }); diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js index aaacf753b..cf716fbe3 100644 --- a/extensions/MyDashboard/web/js/query.js +++ b/extensions/MyDashboard/web/js/query.js @@ -147,10 +147,14 @@ YUI({ dataTable.plug(Y.Plugin.DataTableSort); dataTable.plug(Y.Plugin.DataTableDataSource, { - datasource: dataSource, - initialRequest: updateQueryTable(default_query), + datasource: dataSource }); + // Initial load + Y.on("contentready", function (e) { + updateQueryTable(default_query); + }, "#query_table"); + Y.one('#query').on('change', function(e) { var index = e.target.get('selectedIndex'); var selected_value = e.target.get("options").item(index).getAttribute('value'); -- cgit v1.2.3-24-g4f1b