Fixed imageviewer header
authorMarcel Werk <burntime@woltlab.com>
Sun, 1 Jan 2017 18:16:59 +0000 (19:16 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 1 Jan 2017 18:17:03 +0000 (19:17 +0100)
wcfsetup/install/files/js/WCF.ImageViewer.js
wcfsetup/install/files/style/ui/imageViewer.scss

index 569d909349c2046aa414e3e386f6098faa891b9b..47f7fb562519433811413b170d1db4aa9660269e 100644 (file)
@@ -539,7 +539,7 @@ $.widget('ui.wcfImageViewer', {
                        
                        // jump to image page or full version
                        case $.ui.keyCode.ENTER:
-                               var $link = this._ui.header.find('> div > h1 > a');
+                               var $link = this._ui.header.find('h1 > a');
                                if ($link.length == 1) {
                                        // forward to image page
                                        window.location = $link.prop('href');
@@ -718,15 +718,15 @@ $.widget('ui.wcfImageViewer', {
                // meta data
                var $title = WCF.String.escapeHTML($image.image.title);
                if ($image.image.link) $title = '<a href="' + $image.image.link + '">' + $title + '</a>';
-               this._ui.header.find('> div > h1').html($title);
+               this._ui.header.find('h1').html($title);
                
                if (!this.options.staticViewer) {
                        var $seriesTitle = ($image.series && $image.series.title ? WCF.String.escapeHTML($image.series.title) : '');
                        if ($image.series.link) $seriesTitle = '<a href="' + $image.series.link + '">' + $seriesTitle + '</a>';
-                       this._ui.header.find('> div > h2').html($seriesTitle);
+                       this._ui.header.find('h2').html($seriesTitle);
                }
                
-               this._ui.header.find('> div > h3').text(WCF.Language.get('wcf.imageViewer.seriesIndex').replace(/{x}/, $image.listItem.data('index') + 1).replace(/{y}/, this._items));
+               this._ui.header.find('h3').text(WCF.Language.get('wcf.imageViewer.seriesIndex').replace(/{x}/, $image.listItem.data('index') + 1).replace(/{y}/, this._items));
                
                this._ui.slideshow.full.data('link', ($image.image.fullURL ? $image.image.fullURL : $image.image.url));
                
@@ -866,7 +866,7 @@ $.widget('ui.wcfImageViewer', {
                this._ui = {
                        buttonNext: $imageList.children('span.wcfImageViewerButtonNext'),
                        buttonPrevious: $imageList.children('span.wcfImageViewerButtonPrevious'),
-                       header: $('<header><div' + (this.options.staticViewer ? '>' : ' class="box64"><a class="jsTooltip"><img /></a>' ) + '<h1 /><h2 /><h3 /></div></header>').appendTo(this._container),
+                       header: $('<header><div' + (this.options.staticViewer ? '>' : ' class="box64"><a class="jsTooltip"><img /></a>' ) + '<div><h1 /><h2 /><h3 /></div></div></header>').appendTo(this._container),
                        imageContainer: $imageContainer,
                        images: [
                                $imageContainer.children('img:eq(0)').on('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function() { $(this).removeClass('animateTransformation'); }),
index aafd1f5c9eb041a9c8d2598040ef0124b516b085..142fcf562198927152d0db0ae4d0b449c098710a 100644 (file)
@@ -38,14 +38,6 @@ $wcfImageViewerFontColor: rgba(211, 211, 211, 1);
                }
        }
        
-       &.wcfImageViewerStatic > header > div {
-               > h1,
-               > h2,
-               > h3 {
-                       margin-left: 0 !important;
-               }
-       }
-       
        &.wcfImageViewerMobile {
                > header,
                > footer {
@@ -167,37 +159,36 @@ $wcfImageViewerFontColor: rgba(211, 211, 211, 1);
                top: 0;
                
                > div {
-                       > h1,
-                       > h2,
-                       > h3 {
-                               color: $wcfImageViewerFontColor;
-                               margin-left: 80px !important;
-                               
-                               > a {
-                                       color: $wcfImageViewerFontColor;
-                               }
-                       }
-                       
-                       > h1 {
-                               font-size: 1.75rem;
-                       }
-                       
-                       > h2 {
-                               font-size: 1.25rem;
-                       }
-                       
-                       > h3 {
-                               color: $wcfImageViewerFontColor;
-                               font-size: .85rem;
-                               margin-top: .25rem;
-                       }
-                       
                        > a > img {
                                height: 64px;
                                width: 64px;
                        }
                }
                
+               h1,
+               h2,
+               h3 {
+                       color: $wcfImageViewerFontColor;
+                       
+                       > a {
+                               color: $wcfImageViewerFontColor;
+                       }
+               }
+               
+               h1 {
+                       font-size: 1.75rem;
+               }
+               
+               h2 {
+                       font-size: 1.25rem;
+               }
+               
+               h3 {
+                       color: $wcfImageViewerFontColor;
+                       font-size: .85rem;
+                       margin-top: .25rem;
+               }
+               
                > .wcfImageViewerButtonClose {
                        position: absolute;
                        right: 26px;