aboutsummaryrefslogtreecommitdiffstats
path: root/source/dataView.js
diff options
context:
space:
mode:
authorzefanja <zefanja@freenet.de>2014-01-03 07:19:54 +0700
committerzefanja <zefanja@freenet.de>2014-01-03 07:19:54 +0700
commit328556250b7168ab5bf1f7ae245b4f4f756a3c3b (patch)
treed2099a37b50df4cdabd0d862ec60203852c0c6ec /source/dataView.js
parentc4853981b195737899333a82d7ab7e4a8d4437ac (diff)
downloadbiblez-ng-328556250b7168ab5bf1f7ae245b4f4f756a3c3b.tar.gz
* fixed bug in api.getUserData()
* fixed bug in dataView (data won't refresh if you select the same category) * improved Module Manager to persist downloaded modules to improve UX
Diffstat (limited to 'source/dataView.js')
-rw-r--r--source/dataView.js45
1 files changed, 25 insertions, 20 deletions
diff --git a/source/dataView.js b/source/dataView.js
index c9444a8..e5d3a21 100644
--- a/source/dataView.js
+++ b/source/dataView.js
@@ -39,19 +39,19 @@ enyo.kind({
return true;
},
+ updateSection: function (inSection) {
+ if(inSection)
+ this.section = inSection;
+ this.sectionChanged();
+ },
+
sectionChanged: function (inSender, inEvent) {
if (this.section === "bookmarks") {
this.$.rbBm.setActive(true);
api.getAllBookmarks(enyo.bind(this, function (inError, inData) {
if(!inError) {
this.data = inData;
- this.$.dataList.setCount(this.data.length);
- if(this.data.length === 0) {
- this.$.noData.show();
- this.$.noData.setContent($L("No Bookmarks.") + " " + $L("Tap on a verse number to add one."));
- } else
- this.$.noData.hide();
- this.$.dataList.refresh();
+ this.updateList();
} else
this.handleError(inError);
}));
@@ -60,12 +60,7 @@ enyo.kind({
api.getAllNotes(enyo.bind(this, function (inError, inData) {
if(!inError) {
this.data = inData;
- this.$.dataList.setCount(this.data.length);
- if(this.data.length === 0) {
- this.$.noData.show();
- this.$.noData.setContent($L("No Bookmarks.") + " " + $L("Tap on a verse number to add one."));
- } else
- this.$.noData.hide();
+ this.updateList();
this.$.dataList.refresh();
} else
this.handleError(inError);
@@ -75,19 +70,29 @@ enyo.kind({
api.getAllHighlights(enyo.bind(this, function (inError, inData) {
if(!inError) {
this.data = inData;
- if(this.data.length === 0) {
- this.$.noData.show();
- this.$.noData.setContent($L("No Bookmarks.") + " " + $L("Tap on a verse number to add one."));
- } else
- this.$.noData.hide();
- this.$.dataList.setCount(this.data.length);
- this.$.dataList.refresh();
+ this.updateList();
} else
this.handleError(inError);
}));
}
},
+ updateList: function () {
+ this.$.dataList.setCount(this.data.length);
+ if(this.data.length === 0) {
+ this.$.noData.show();
+ if(this.section === "bookmarks")
+ this.$.noData.setContent($L("No Bookmarks.") + " " + $L("Tap on a verse number to add one."));
+ else if(this.section === "note")
+ this.$.noData.setContent($L("No Notes.") + " " + $L("Tap on a verse number to add one."));
+ else if(this.section === "highlights")
+ this.$.noData.setContent($L("No Highlights.") + " " + $L("Tap on a verse number to add one."));
+ } else
+ this.$.noData.hide();
+ this.$.dataList.refresh();
+ this.$.dataList.reflow();
+ },
+
setupItem: function(inSender, inEvent) {
var data = this.data[inEvent.index];
this.$.itemOsis.setContent(api.formatOsis(data.osisRef));