diff --git a/media/css/seahub.css b/media/css/seahub.css index f8c423dd9b..3744a00093 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -1677,6 +1677,95 @@ button.sf-dropdown-toggle:focus { text-decoration:none; color:#fff; } + +/* mobile flie-menu */ +.mobile-menu-mask { + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: 99; + background-color: #000; + opacity: 0.1; +} + +.mobile-menu-content { + position: fixed; + width: 100%; + left: 0; + bottom: 0; + z-index: 100; + background-color: #fff; +} + +.mobile-menu-content ul { + border-top: solid 1px #eee; +} + +.mobile-menu-content ul li { + line-height: 40px; + text-align: center; +} + +.mobile-menu-content ul li:hover{ + background-color: #eb8205; +} + +.mobile-menu-content a { + display: inline-block; + width: 100%; + height: 100%; + color: #000; +} + +/*mobiel editor-menu and responsed */ +@media (max-width: 991.98px) { + #file-enc-cont { + width: 100%; + display: none; + } + .CodeMirror.CodeMirror-wrap{ + width: 100%; + margin-top: -20px; + } + + .sf2-mobile-menu-toggle { + font-size: 22px; + line-height: 1; + color: #999; + margin-top: 8px; + } + + .sf2-mobile-menu-toggle:hover { + text-decoration: none; + color:#999; + } + + .sf2-mobile-menu { + position: absolute; + display: none; + top: 50px; + right: 10px; + background:#fff; + z-index: 20; + } + + .sf2-mobile-menu ul li a { + min-width: 10rem; + padding: 0.5rem 0.75rem; + } + + #file-view { + width: 100% !important; + border-right: none !important; + } + + #pdf { + width: 95%; + } +} + /**** discussions/comments ****/ .msg { padding:5px 10px; @@ -4234,91 +4323,3 @@ img.thumbnail { display:inline-block; margin-top:4px; } - -/* mobile-menu */ -.mobile-menu-mask { - position: fixed; - width: 100%; - height: 100%; - top: 0; - left: 0; - z-index: 99; - background-color: #000; - opacity: 0.1; -} - -.mobile-menu-content { - position: fixed; - width: 100%; - left: 0; - bottom: 0; - z-index: 100; - background-color: #fff; -} - -.mobile-menu-content ul { - border-top: solid 1px #eee; -} - -.mobile-menu-content ul li { - line-height: 40px; - text-align: center; -} - -.mobile-menu-content ul li:hover{ - background-color: #eb8205; -} - -.mobile-menu-content a { - display: inline-block; - width: 100%; - height: 100%; - color: #000; -} - -/* // Medium devices (tablets, less than 992px) */ -@media (max-width: 991.98px) { - #file-enc-cont { - width: 100%; - display: none; - } - .CodeMirror.CodeMirror-wrap{ - width: 100%; - margin-top: -20px; - } - - .sf2-mobile-menu-toggle { - font-size: 22px; - line-height: 1; - color: #999; - margin-top: 8px; - } - - .sf2-mobile-menu-toggle:hover { - text-decoration: none; - color:#999; - } - - .sf2-mobile-menu { - position: absolute; - display: none; - top: 50px; - right: 10px; - background:#fff; - z-index: 20; - } - - .sf2-mobile-menu ul li a { - min-width: 10rem; - padding: 0.5rem 0.75rem; - } - - #file-view { - width: 100% !important; - border-right: none !important; - } - - #pdf { - width: 95%; - } -} diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index 2f73c8c5c4..5e893a7b93 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -72,7 +72,7 @@ {% endif %} {% else %} - {% block file_view %}{% endblock %} + {% block file_view %}{% endblock %} {% endif %} @@ -581,11 +581,11 @@ $(document).on('keydown', function(e) { }); var DropDownMenu = { - $el : $("#file-view-op"), - $mobileTmp : _.template($("#mobile-editor-tools-tmpl").html()), - $deviceTmp : _.template($("#editor-tools-tmpl").html()), + $el: $("#file-view-op"), + $mobileTmp: _.template($("#mobile-editor-tools-tmpl").html()), + $deviceTmp: _.template($("#editor-tools-tmpl").html()), - init: function(){ + init: function() { var _this = this; this.render(); window.onresize = function(){ @@ -593,7 +593,7 @@ var DropDownMenu = { } }, - render : function(){ + render: function() { var _this = this; var template = $(window).width() > 992 ? this.$deviceTmp : this.$mobileTmp; this.$el.html(template); @@ -617,7 +617,7 @@ var DropDownMenu = { }); //if mobile : bind the popmenu event - if($(".sf2-mobile-menu-toggle").length){ + if ($(".sf2-mobile-menu-toggle").length) { $(".sf2-mobile-menu-toggle").on('click',function(){ _this.clickToShowPopMenu(); return false; @@ -625,7 +625,7 @@ var DropDownMenu = { $(document).on('click', function(e){ var target = e.target || event.srcElement; var isDisplay = $('.sf2-mobile-menu').css('display') === "block" ? true : false; - if(!isDisplay){ + if (!isDisplay) { return true; } @@ -641,7 +641,7 @@ var DropDownMenu = { } }, - clickToggleLock : function(eventSource){ + clickToggleLock: function(eventSource) { this.clickToClosePopMenu(); var op = $(eventSource).attr('id') == 'lock-file' ? 'lock' : 'unlock', path = '{{path|escapejs}}'; @@ -659,7 +659,7 @@ var DropDownMenu = { }); }, - clickToShare : function(eventSource){ + clickToShare: function(eventSource) { this.clickToClosePopMenu(); var op = $(eventSource), name = "{{filename|escapejs}}", @@ -676,7 +676,7 @@ var DropDownMenu = { return false; }, - clickToCommet : function(){ + clickToCommet: function() { if (fileDiscussions.$el.is(':visible')) { fileDiscussions.hide(); } else { @@ -684,12 +684,12 @@ var DropDownMenu = { } }, - clickToClosePopMenu : function(){ + clickToClosePopMenu: function() { $(".sf2-mobile-menu-mask").hide(); $(".sf2-mobile-menu").hide(); }, - clickToShowPopMenu : function(){ + clickToShowPopMenu: function() { $(".sf2-mobile-menu-mask").show(); $(".sf2-mobile-menu").show(); } diff --git a/static/scripts/app/views/dirent.js b/static/scripts/app/views/dirent.js index 619136307f..51c386c292 100644 --- a/static/scripts/app/views/dirent.js +++ b/static/scripts/app/views/dirent.js @@ -735,9 +735,9 @@ define([ return true; }, - showMobileMenu : function(event) { + showMobileMenu: function(event) { var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; - if(mobileMenu){ + if (mobileMenu) { mobileMenu.slideDown('fast'); } return false; @@ -745,12 +745,12 @@ define([ hideMobileMenu: function() { var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; - if(mobileMenu){ + if (mobileMenu) { mobileMenu.slideUp('fast'); } }, - closeMobileMenu: function(){ + closeMobileMenu: function() { this.hideMobileMenu(); return false; } diff --git a/static/scripts/app/views/repo.js b/static/scripts/app/views/repo.js index 70219e4b15..8312b22d88 100644 --- a/static/scripts/app/views/repo.js +++ b/static/scripts/app/views/repo.js @@ -461,9 +461,9 @@ define([ return false; }, - showMobileMenu : function(event) { + showMobileMenu: function(event) { var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; - if(mobileMenu){ + if (mobileMenu) { mobileMenu.slideDown('fast'); } return false; @@ -471,12 +471,12 @@ define([ hideMobileMenu: function() { var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; - if(mobileMenu){ + if (mobileMenu) { mobileMenu.slideUp('fast'); } }, - closeMobileMenu: function(){ + closeMobileMenu: function() { this.hideMobileMenu(); return false; }