From 7402125eba5c4d4c47c4419954c1e0f47b59a8fd Mon Sep 17 00:00:00 2001 From: Timm Haucke Date: Fri, 24 Oct 2014 17:50:28 +0200 Subject: [PATCH] [#161]add basic loading indicator component and include it in the data view --- components/dataRepresentation/index.html | 3 ++- components/dataRepresentation/index.js | 3 ++- components/dataRepresentation/index.less | 1 - lib/view.js | 3 ++- views/data/index.html | 2 +- views/data/index.js | 4 ++++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/components/dataRepresentation/index.html b/components/dataRepresentation/index.html index 1778acad..218fda01 100644 --- a/components/dataRepresentation/index.html +++ b/components/dataRepresentation/index.html @@ -26,6 +26,7 @@ -
{{ 'No Data available' | i18n }}
+
{{ 'No Data available' | i18n }}
+
diff --git a/components/dataRepresentation/index.js b/components/dataRepresentation/index.js index 4f04056c..82c993bb 100644 --- a/components/dataRepresentation/index.js +++ b/components/dataRepresentation/index.js @@ -5,7 +5,8 @@ module.exports = { isInteractive: true, sortOldest: false, sortKey: 'submitted', - sortOptions: ['Newest', 'Oldest'] + sortOptions: ['Newest', 'Oldest'], + initialDataLoaded: false }, methods: { formatUnixTime: function(unix) { diff --git a/components/dataRepresentation/index.less b/components/dataRepresentation/index.less index 14036dcf..8e7c1e06 100644 --- a/components/dataRepresentation/index.less +++ b/components/dataRepresentation/index.less @@ -118,5 +118,4 @@ font-size: 14px; color: @darkGrey; } - } diff --git a/lib/view.js b/lib/view.js index 39a0bb86..84f156d7 100644 --- a/lib/view.js +++ b/lib/view.js @@ -13,7 +13,8 @@ var componentList = { slideToggle: require('../components/slide-toggle'), alert: require('../components/alert'), dataRepresentation: require('../components/dataRepresentation'), - switch: require('../components/switch') + switch: require('../components/switch'), + loadingIndicator: require('../components/loadingIndicator') }; // Add all blocks diff --git a/views/data/index.html b/views/data/index.html index d9f0e988..79f00386 100644 --- a/views/data/index.html +++ b/views/data/index.html @@ -1,6 +1,6 @@
-
+
diff --git a/views/data/index.js b/views/data/index.js index d9d7bd21..98a08700 100644 --- a/views/data/index.js +++ b/views/data/index.js @@ -6,6 +6,9 @@ var Data = require('../../lib/data'); module.exports = view.extend({ id: 'data', template: require('./index.html'), + data: { + initialDataLoaded: false + }, created: function () { var self = this; @@ -22,6 +25,7 @@ module.exports = view.extend({ self.currentDataSets = []; data.getAllDataSets(function(currentDataSets) { + self.$data.initialDataLoaded = true; self.currentDataSets = currentDataSets; }); }