diff options
author | zefanja <zefanja@freenet.de> | 2014-02-14 13:48:28 +0700 |
---|---|---|
committer | zefanja <zefanja@freenet.de> | 2014-02-14 13:48:28 +0700 |
commit | 6d15160966c535f6ddf7f3139d81f8ade9fa304b (patch) | |
tree | 7f9bf906b1e0e42c375ef19b28aec03cf4ae0cf3 | |
parent | ab33f85e2430c08b0ee0f1eadb89a57e7fd83a69 (diff) | |
download | biblez-ng-6d15160966c535f6ddf7f3139d81f8ade9fa304b.tar.gz |
* added book title to cha
-rw-r--r-- | assets/back.png | bin | 289 -> 384 bytes | |||
m--------- | lib/sword | 0 | ||||
-rw-r--r-- | source/App.css | 6 | ||||
-rw-r--r-- | source/bcSelector.js | 19 |
4 files changed, 22 insertions, 3 deletions
diff --git a/assets/back.png b/assets/back.png Binary files differindex 918eedc..1dcdac2 100644 --- a/assets/back.png +++ b/assets/back.png 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 |