Skip to content

Commit

Permalink
Task #27 Adding 'no bookmarks' message.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesgs committed Sep 23, 2015
1 parent 3590a2f commit 5211bba
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions assets/js/bookmark.js
@@ -1,5 +1,7 @@
(function ($) {

/**
* @todo Add l10n/i18n support
*/
$(function() {
var $bookmark = $('#bookmark-comic'),
$bookmarkComicHistory = $('#bookmark-comic-history');
Expand Down Expand Up @@ -93,13 +95,7 @@
var self = this,
revBookmarkHistory = JSON.parse(self.storage.getItem(self.BOOKMARK_HISTORY));

if (revBookmarkHistory.length == 0) {
// No bookmarks available
return;
}

var bookmarkHistory = revBookmarkHistory.reverse(),
$historyModal = $('<div id="bookmark-history-modal"><div id="bookmark-history-content"></div><p>[<a href="#" id="bookmark-history-close">close</a>]</p></div>')
var $historyModal = $('<div id="bookmark-history-modal"><div id="bookmark-history-content"></div><p>[<a href="#" id="bookmark-history-close">close</a>]</p></div>')
.css({
'width': '300px',
'z-index' : 9999,
Expand All @@ -112,7 +108,12 @@
});

$historyModal.find('#bookmark-history-content').html(function(){
var htmlString = "<table>";
if (revBookmarkHistory.length == 0) {
return '<p>No bookmark history available.</p>';
}

var htmlString = "<table>",
bookmarkHistory = revBookmarkHistory.reverse();

htmlString = "<thead><tr><td>Title</td><td>Date</td></tr></thead>";

Expand Down

0 comments on commit 5211bba

Please sign in to comment.