summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-07-10 10:57:35 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-07-10 10:57:35 -0400
commitaf0bf0486c25b7af0b237a33e2c1088924b84d0c (patch)
treeb41cd75fae87d518345aabf25f32e18ebfb1dcde /js
parentd6532b0418fda7f97e72b6bfdbac2b401055c925 (diff)
update views when you remove a feed or mark item as read
Diffstat (limited to 'js')
-rw-r--r--js/news.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/news.js b/js/news.js
index 82cd248a0..f3f65a258 100644
--- a/js/news.js
+++ b/js/news.js
@@ -110,7 +110,8 @@ News={
if(answer == true) {
$.post(OC.filePath('news', 'ajax', 'deletefeed.php'),{'feedid':feedid},function(jsondata){
if(jsondata.status == 'success'){
- alert('removed!');
+ $('#leftcontent [data-id="'+jsondata.data.feedid+'"]').remove();
+ //change the right view too (maybe a message to subscribe, like in Google Reader?)
}
else{
OC.dialogs.alert(jsondata.data.message, t('news', 'Error'));
@@ -123,7 +124,10 @@ News={
markItem:function(itemid) {
$.post(OC.filePath('news', 'ajax', 'markitem.php'),{'itemid':itemid},function(jsondata){
if(jsondata.status == 'success'){
-
+ var $currentitem = $('#rightcontent [data-id="'+jsondata.data.itemid+'"]');
+ $currentitem.removeClass('title_unread');
+ $currentitem.addClass('title_read');
+ //set a timeout for this
}
else{
OC.dialogs.alert(jsondata.data.message, t('news', 'Error'));