diff options
-rw-r--r-- | include/functions.php | 12 | ||||
-rw-r--r-- | js/viewfeed.js | 13 |
2 files changed, 20 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php index dae87dab3..dcaa67e56 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3693,13 +3693,15 @@ $rv .= "<hr clear='both'/>"; } - $rv .= "<br/><div dojoType=\"dijit.form.DropDownButton\">". - "<span>" . __('Attachments')."</span>"; - $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">"; + $rv .= "<select onchange=\"openSelectedAttachment(this)\">". + "<option value=''>" . __('Attachments')."</option>"; - foreach ($entries_html as $entry) { $rv .= $entry; }; + foreach ($entries as $entry) { + $rv .= "<option value=\"".htmlspecialchars($entry["url"])."\">" . htmlspecialchars($entry["filename"]) . "</option>"; - $rv .= "</div></div>"; + }; + + $rv .= "</select>"; } return $rv; diff --git a/js/viewfeed.js b/js/viewfeed.js index 28d4ea8ec..1d04c4276 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -2115,3 +2115,16 @@ function displayArticleUrl(id) { } } +function openSelectedAttachment(elem) { + try { + var url = elem[elem.selectedIndex].value; + + if (url) { + window.open(url); + elem.selectedIndex = 0; + } + + } catch (e) { + exception_error("openSelectedAttachment", e); + } +} |