fix RTL toggling

H2 within an item preview was toggled to rtl and back to ltr
immediately.
This commit is contained in:
Mathias Kresin 2014-12-26 10:24:34 +01:00
parent df4f3b2a52
commit 3fe424999f
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ f.open("POST","?action=mark-item-unread&id="+c,!0);f.send()}return{MarkAsRead:c,
else if(b.setAttribute("data-item-bookmark",f),Miniflux.Nav.IsListing())c=b.querySelector("a.bookmark"),d(c);else if((c=b.querySelector("a.bookmark-icon"))&&c.hasAttribute("data-reverse-title")){var e=c.getAttribute("title");c.setAttribute("title",c.getAttribute("data-reverse-title"));c.setAttribute("data-reverse-title",e)}};h.open("POST","?action=bookmark&id="+c+"&value="+f,!0);h.send()},SwitchStatus:function(b){var a=b.getAttribute("data-item-status");"read"===a?g(b):"unread"===a&&c(b)},Show:function(b){(b=
b.querySelector("a.show"))&&b.click()},OpenOriginal:function(b){var a=b.querySelector("a.original");a&&("unread"===b.getAttribute("data-item-status")&&c(b),a.removeAttribute("data-action"),a.click())},DownloadContent:function(b){var a=document.getElementById("download-item");if(a){a.innerHTML=" "+a.getAttribute("data-before-message");a.className="loading-icon";var c=new XMLHttpRequest;c.onload=function(){var b=JSON.parse(c.responseText);a.className="";if(b.result){var d=document.getElementById("item-content");
d&&(d.innerHTML=b.content);a.innerHTML=a.getAttribute("data-after-message")}else a.innerHTML=a.getAttribute("data-failure-message")};b=e(b);c.open("POST","?action=download-item&id="+b,!0);c.send()}},MarkListingAsRead:function(b){for(var a=document.getElementsByTagName("article"),c=[],d=0,g=a.length;d<g;d++)c.push(e(a[d]));a=new XMLHttpRequest;a.onload=function(){window.location.href=b};a.open("POST","?action=mark-items-as-read",!0);a.send(JSON.stringify(c))},ToggleRTLMode:function(){for(var a=["#current-item h1",
"#item-content","#current-item h2","#current-item .preview"],c=0;c<a.length;c++){var d=document.querySelector(a[c]);d&&(d.dir=""==d.dir?"rtl":"")}}}}();
"#item-content","#listing #current-item h2","#listing #current-item .preview"],c=0;c<a.length;c++){var d=document.querySelector(a[c]);d&&(d.dir=""==d.dir?"rtl":"")}}}}();
Miniflux.Event=function(){var e=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(d){var a=d.target.getAttribute("data-action");if(a){Miniflux.Event.lastEventType="mouse";var c;a:{for(element=d.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"===element.tagName.toLowerCase()){c=element;break a}c=null}switch(a){case "refresh-all":d.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":d.preventDefault();Miniflux.Feed.Update(d.target.getAttribute("data-feed-id"));
break;case "mark-read":d.preventDefault();Miniflux.Item.MarkAsRead(c);break;case "mark-unread":d.preventDefault();Miniflux.Item.MarkAsUnread(c);break;case "mark-removed":d.preventDefault();Miniflux.Item.MarkAsRemoved(c);break;case "bookmark":d.preventDefault();Miniflux.Item.SwitchBookmark(c);break;case "download-item":d.preventDefault();Miniflux.Item.DownloadContent(c);break;case "original-link":d.preventDefault();Miniflux.Item.OpenOriginal(c);break;case "mark-all-read":d.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");
break;case "mark-feed-read":d.preventDefault(),Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+d.target.getAttribute("data-feed-id"))}}}},ListenKeyboardEvents:function(){document.onkeypress=function(d){if(63==d.keyCode||!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)){var a=d.target||d.srcElement;if("INPUT"!=a.tagName&&"TEXTAREA"!=a.tagName)if(Miniflux.Event.lastEventType="keyboard",e.push(d.keyCode||d.which),103===e[0])switch(e[1]){case void 0:break;case 117:window.location.href="?action=unread";

View File

@ -235,8 +235,8 @@ Miniflux.Item = (function() {
var tags = [
"#current-item h1",
"#item-content",
"#current-item h2",
"#current-item .preview"
"#listing #current-item h2",
"#listing #current-item .preview"
];
for (var i = 0; i < tags.length; i++) {