aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/back.pngbin289 -> 384 bytes
m---------lib/sword0
-rw-r--r--source/App.css6
-rw-r--r--source/bcSelector.js19
4 files changed, 22 insertions, 3 deletions
diff --git a/assets/back.png b/assets/back.png
index 918eedc..1dcdac2 100644
--- a/assets/back.png
+++ b/assets/back.png
Binary files differ
diff --git a/lib/sword b/lib/sword
-Subproject 7420c0b47b03884e14a54631a1cb6bb8491afa1
+Subproject 7cd74d363e4d8fca0355de9abc6edbd19be6f10
diff --git a/source/App.css b/source/App.css
index fcd3296..9efc318 100644
--- a/source/App.css
+++ b/source/App.css
@@ -144,6 +144,12 @@
background-color: #F0E68C;
}
+.text-ellipsis {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
/* POPUPs */
.message-popup {
text-align: center;
diff --git a/source/bcSelector.js b/source/bcSelector.js
index 43a5231..ab75075 100644
--- a/source/bcSelector.js
+++ b/source/bcSelector.js
@@ -23,9 +23,9 @@ enyo.kind({
]}
]},
{name: "chapterPanel", kind: "enyo.FittableRows", components: [
- {kind: "onyx.Toolbar", components: [
- {kind: "onyx.IconButton", src: "assets/back.png", ontap: "handleBack"},
- {content: $L("Chapters")}
+ {name: "tbChapter", kind: "onyx.Toolbar", components: [
+ {kind: "onyx.IconButton", src: "assets/back.png", ontap: "handleBack"},
+ {name: "chapterLabel", content: $L("Chapters"), classes: "text-ellipsis"}
]},
{kind: "enyo.Scroller", fit: true, touch: true, components: [
{name: "chapterRepeater", kind: "Repeater", count: 0, onSetupItem: "setChapterItems", components: [
@@ -68,7 +68,14 @@ enyo.kind({
handleBook: function (inSender, inEvent) {
this.currentBook = this.books[inEvent.index];
this.$.chapterRepeater.setCount(this.currentBook.maxChapter);
+ this.$.chapterLabel.setContent($L("Chapters in ") + this.currentBook.name);
this.$.bcPanel.setIndex(1);
+ //truncate text if the label's width is longer than window.innerWidth
+ if(window.innerWidth - 60 < this.$.chapterLabel.hasNode().clientWidth) {
+ var w = this.$.tbChapter.hasNode().clientWidth - 60 + "px";
+ this.$.chapterLabel.applyStyle("width", w);
+ }
+
},
setChapterItems: function (inSender, inEvent) {
@@ -78,5 +85,11 @@ enyo.kind({
handleChapter: function (inSender, inEvent) {
this.doSelect({book: this.currentBook, chapter: inEvent.index+1, osis: this.currentBook.abbrev + "." + (inEvent.index+1), label: this.currentBook.abbrev + " " + (inEvent.index+1)});
this.$.bcPanel.setIndex(0);
+ },
+
+ resizeHandler: function () {
+ this.inherited(arguments);
+ var w = this.$.tbChapter.hasNode().clientWidth - 60 + "px";
+ this.$.chapterLabel.applyStyle("width", w);
}
}); \ No newline at end of file