]> git.wh0rd.org Git - tt-rss.git/commitdiff
replace catchupCurrentFeed dropdown with a better control
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 3 Apr 2013 14:20:14 +0000 (18:20 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 3 Apr 2013 14:20:14 +0000 (18:20 +0400)
index.php
js/feedlist.js

index dd3d34b3ad911e0974f210626348cbd774b59bb1..a8cc38ca33a06e981d6b6ce3795ea5bfe27215cb 100644 (file)
--- a/index.php
+++ b/index.php
                        <option value="date_reverse"><?php echo __('Oldest first') ?></option>
                </select>
 
-               <select title="<?php echo __('Mark feed as read') ?>"
-                       onchange="catchupCurrentFeed(this)"
-                       dojoType="dijit.form.Select" name="catchup_feed">
-                       <option selected="selected" value="default"><?php echo __('Mark as read') ?></option>
-                       <option value="all"><?php echo __('All articles') ?></option>
-                       <option value="1day"><?php echo __('Older than one day') ?></option>
-                       <option value="1week"><?php echo __('Older than one week') ?></option>
-                       <option value="2weeks"><?php echo __('Older than two weeks') ?></option>
-               </select>
+               <div dojoType="dijit.form.ComboButton" onclick="catchupCurrentFeed()">
+                       <span><?php echo __('Mark as read') ?></span>
+                       <div dojoType="dijit.DropDownMenu">
+                               <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1day')">
+                                       <?php echo __('Older than one day') ?>
+                               </div>
+                               <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1week')">
+                                       <?php echo __('Older than one week') ?>
+                               </div>
+                               <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('2week')">
+                                       <?php echo __('Older than two weeks') ?>
+                               </div>
+                       </div>
+               </div>
 
                </form>
 
index 9d643142b09382d1be20e262e7971f0c03417a65..3154a2887b2e8685d178662bc73a1a41d0fe6b1b 100644 (file)
@@ -380,20 +380,8 @@ function getNextUnreadFeed(feed, is_cat) {
        }
 }
 
-function catchupCurrentFeed(elem) {
-
-       if (elem) {
-               var toolbar = document.forms["main_toolbar_form"];
-               var catchup_feed = dijit.getEnclosingWidget(toolbar.catchup_feed);
-               var mode = catchup_feed.attr('value');
-
-               if (mode != 'default') {
-                       catchupFeed(getActiveFeedId(), activeFeedIsCat(), mode);
-                       catchup_feed.attr('value', 'default');
-               }
-       } else {
-               catchupFeed(getActiveFeedId(), activeFeedIsCat());
-       }
+function catchupCurrentFeed(mode) {
+       catchupFeed(getActiveFeedId(), activeFeedIsCat(), mode);
 }
 
 function catchupFeedInGroup(id) {