1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 01:20:32 +00:00

repair the code style

This commit is contained in:
shanshuirenjia
2018-07-31 16:59:46 +08:00
parent 12fb7a18f0
commit 998ca7d675
4 changed files with 110 additions and 109 deletions

View File

@@ -1677,6 +1677,95 @@ button.sf-dropdown-toggle:focus {
text-decoration:none; text-decoration:none;
color:#fff; 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 ****/ /**** discussions/comments ****/
.msg { .msg {
padding:5px 10px; padding:5px 10px;
@@ -4234,91 +4323,3 @@ img.thumbnail {
display:inline-block; display:inline-block;
margin-top:4px; 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%;
}
}

View File

@@ -72,7 +72,7 @@
{% endif %} {% endif %}
</div> </div>
{% else %} {% else %}
{% block file_view %}{% endblock %} {% block file_view %}{% endblock %}
{% endif %} {% endif %}
</div> </div>
<div id="file-discussions" class="comments-panel" style="display:none;"></div> <div id="file-discussions" class="comments-panel" style="display:none;"></div>
@@ -581,11 +581,11 @@ $(document).on('keydown', function(e) {
}); });
var DropDownMenu = { var DropDownMenu = {
$el : $("#file-view-op"), $el: $("#file-view-op"),
$mobileTmp : _.template($("#mobile-editor-tools-tmpl").html()), $mobileTmp: _.template($("#mobile-editor-tools-tmpl").html()),
$deviceTmp : _.template($("#editor-tools-tmpl").html()), $deviceTmp: _.template($("#editor-tools-tmpl").html()),
init: function(){ init: function() {
var _this = this; var _this = this;
this.render(); this.render();
window.onresize = function(){ window.onresize = function(){
@@ -593,7 +593,7 @@ var DropDownMenu = {
} }
}, },
render : function(){ render: function() {
var _this = this; var _this = this;
var template = $(window).width() > 992 ? this.$deviceTmp : this.$mobileTmp; var template = $(window).width() > 992 ? this.$deviceTmp : this.$mobileTmp;
this.$el.html(template); this.$el.html(template);
@@ -617,7 +617,7 @@ var DropDownMenu = {
}); });
//if mobile : bind the popmenu event //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(){ $(".sf2-mobile-menu-toggle").on('click',function(){
_this.clickToShowPopMenu(); _this.clickToShowPopMenu();
return false; return false;
@@ -625,7 +625,7 @@ var DropDownMenu = {
$(document).on('click', function(e){ $(document).on('click', function(e){
var target = e.target || event.srcElement; var target = e.target || event.srcElement;
var isDisplay = $('.sf2-mobile-menu').css('display') === "block" ? true : false; var isDisplay = $('.sf2-mobile-menu').css('display') === "block" ? true : false;
if(!isDisplay){ if (!isDisplay) {
return true; return true;
} }
@@ -641,7 +641,7 @@ var DropDownMenu = {
} }
}, },
clickToggleLock : function(eventSource){ clickToggleLock: function(eventSource) {
this.clickToClosePopMenu(); this.clickToClosePopMenu();
var op = $(eventSource).attr('id') == 'lock-file' ? 'lock' : 'unlock', var op = $(eventSource).attr('id') == 'lock-file' ? 'lock' : 'unlock',
path = '{{path|escapejs}}'; path = '{{path|escapejs}}';
@@ -659,7 +659,7 @@ var DropDownMenu = {
}); });
}, },
clickToShare : function(eventSource){ clickToShare: function(eventSource) {
this.clickToClosePopMenu(); this.clickToClosePopMenu();
var op = $(eventSource), var op = $(eventSource),
name = "{{filename|escapejs}}", name = "{{filename|escapejs}}",
@@ -676,7 +676,7 @@ var DropDownMenu = {
return false; return false;
}, },
clickToCommet : function(){ clickToCommet: function() {
if (fileDiscussions.$el.is(':visible')) { if (fileDiscussions.$el.is(':visible')) {
fileDiscussions.hide(); fileDiscussions.hide();
} else { } else {
@@ -684,12 +684,12 @@ var DropDownMenu = {
} }
}, },
clickToClosePopMenu : function(){ clickToClosePopMenu: function() {
$(".sf2-mobile-menu-mask").hide(); $(".sf2-mobile-menu-mask").hide();
$(".sf2-mobile-menu").hide(); $(".sf2-mobile-menu").hide();
}, },
clickToShowPopMenu : function(){ clickToShowPopMenu: function() {
$(".sf2-mobile-menu-mask").show(); $(".sf2-mobile-menu-mask").show();
$(".sf2-mobile-menu").show(); $(".sf2-mobile-menu").show();
} }

View File

@@ -735,9 +735,9 @@ define([
return true; return true;
}, },
showMobileMenu : function(event) { showMobileMenu: function(event) {
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
if(mobileMenu){ if (mobileMenu) {
mobileMenu.slideDown('fast'); mobileMenu.slideDown('fast');
} }
return false; return false;
@@ -745,12 +745,12 @@ define([
hideMobileMenu: function() { hideMobileMenu: function() {
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
if(mobileMenu){ if (mobileMenu) {
mobileMenu.slideUp('fast'); mobileMenu.slideUp('fast');
} }
}, },
closeMobileMenu: function(){ closeMobileMenu: function() {
this.hideMobileMenu(); this.hideMobileMenu();
return false; return false;
} }

View File

@@ -461,9 +461,9 @@ define([
return false; return false;
}, },
showMobileMenu : function(event) { showMobileMenu: function(event) {
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
if(mobileMenu){ if (mobileMenu) {
mobileMenu.slideDown('fast'); mobileMenu.slideDown('fast');
} }
return false; return false;
@@ -471,12 +471,12 @@ define([
hideMobileMenu: function() { hideMobileMenu: function() {
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null; var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
if(mobileMenu){ if (mobileMenu) {
mobileMenu.slideUp('fast'); mobileMenu.slideUp('fast');
} }
}, },
closeMobileMenu: function(){ closeMobileMenu: function() {
this.hideMobileMenu(); this.hideMobileMenu();
return false; return false;
} }