summaryrefslogtreecommitdiffstats
path: root/js/menu.js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-08-31 19:52:53 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-09-01 00:31:39 +0200
commit9b0ccc5641aa49d6b41a846d9c63bfc5746efe88 (patch)
treeb87b8ea9390a353c4d497719f722fa117b36b67b /js/menu.js
parent3876f38f3cb82545c075026ab0b149e00bd9eaef (diff)
wired removing and adding of feeds
Diffstat (limited to 'js/menu.js')
-rw-r--r--js/menu.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/js/menu.js b/js/menu.js
index 7e5170573..f302f6ae4 100644
--- a/js/menu.js
+++ b/js/menu.js
@@ -152,7 +152,8 @@ var News = News || {};
}
var $html;
- var icon = 'url("' + data.icon + '")';
+ var icon;
+
switch(type){
case MenuNodeType.Feed:
$html = this._$mockFeed.clone();
@@ -166,7 +167,9 @@ var News = News || {};
}
$html.children('.title').html(data.title);
- $html.children('.title').css('background-image', icon);
+ if(data.icon !== undefined){
+ $html.children('.title').css('background-image', 'url("' + data.icon + '")');
+ }
$html.children('.unread_items_counter').html(data.unreadCount);
$html.attr('data-id', id);
$html.children('ul').attr('data-id', id);
@@ -249,6 +252,7 @@ var News = News || {};
Menu.prototype.setShowAll = function(showAll){
this._showAll = showAll;
this.triggerHideRead();
+ this._load(this._activeFeedType, this._activeFeedId);
};
/**
@@ -378,11 +382,11 @@ var News = News || {};
});
$listItem.children('.buttons').children('.feeds_delete').click(function(){
- self._delete(MenuNodeType.Folder, id);
+ self._delete(MenuNodeType.Feed, id);
});
$listItem.children('.buttons').children('.feeds_markread').click(function(){
- self._markRead(MenuNodeType.Folder, id);
+ self._markRead(MenuNodeType.Feed, id);
});
$listItem.draggable({
@@ -401,11 +405,12 @@ var News = News || {};
* @param $listItem the jquery list element
*/
Menu.prototype._bindStarred = function($listItem){
+ var self = this;
this._setUnreadCount(MenuNodeType.Starred, 0,
this._getAndRemoveUnreadCount($listItem));
$listItem.children('.title').click(function(){
- self._load(MenuNodeType.Starred, id);
+ self._load(MenuNodeType.Starred, -1);
return false;
});
@@ -416,13 +421,14 @@ var News = News || {};
* @param $listItem the jquery list element
*/
Menu.prototype._bindSubscriptions = function($listItem){
+ var self = this;
$listItem.children('.title').click(function(){
- self._load(MenuNodeType.Subscriptions, id);
+ self._load(MenuNodeType.Subscriptions, -2);
return false;
});
$listItem.children('.feeds_markread').click(function(){
- self._markRead(MenuNodeType.Folder, id);
+ self._markRead(MenuNodeType.Subscriptions, 0);
});
};
@@ -477,6 +483,7 @@ var News = News || {};
if(type === self._activeFeedType && id === self._activeFeedId){
window.location.reload();
}
+ self._resetOpenFolders();
} else{
OC.dialogs.alert(jsondata.data.message, t('news', 'Error'));
}