Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Jan 20, 2024
1 parent 9a63f67 commit f01a711
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 18 deletions.
1 change: 1 addition & 0 deletions application/library/modal/modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type Button struct {
type Modal struct {
Id string //元素id
Custom bool //是否自定义整个内容区域
Full bool // 是否铺满整个页面
HeadTitle string //头部标题
Title string //内容标题
Content string //内容
Expand Down
5 changes: 5 additions & 0 deletions public/assets/backend/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4970,6 +4970,11 @@ button::-moz-focus-inner {
.md-content .modal-header + .modal-body {
max-height:calc(100vh - 70px - 80px);
}
.md-modal-full,.modal-full{
width:100%;max-width:100%;left:0;top:0;transform:none;height:100vh
}
.md-modal-full .md-content,
.modal-full .modal-content{height:100%}
.colored-header .modal-header {
padding: 20px;
border-bottom: 1px solid #1080de !important;
Expand Down
2 changes: 1 addition & 1 deletion public/assets/backend/css/style.min.css

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions public/assets/backend/js/behaviour/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -1740,13 +1740,6 @@ var App = function () {
}
});
},
resizeModalHeight: function (el) {
var h = $(window).height() - 200;
if (h < 200) h = 200;
$(el).css({ "max-height": h + 'px' });
//var bh = h - 150;
//$(el).find('.modal-body').css({ "max-height": bh + 'px' });
},
switchStatus: function (a, type, editURL, callback) {
if (type == null) type = $(a).data('type');
var v = $(a).val();
Expand Down
2 changes: 1 addition & 1 deletion public/assets/backend/js/behaviour/general.min.js

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions public/assets/backend/js/behaviour/page/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ $(function(){
}
var modalId=$(this).attr('dropzone-modal');
if(!modalId) return;
dz.on('addedfiles',function(){App.resizeModalHeight(modalId);});
$(this).on('click',function(event){
$(modalId).niftyModal('show',{
closeOnClickOverlay:false,
Expand All @@ -214,12 +213,8 @@ $(function(){
})
initCodeMirrorEditor();
$(window).off().on('resize',function(){
$('#file-edit-modal,#file-play-modal').css({height:$(window).height(),width:'100%','max-width':'100%',left:0,top:0,transform:'none'});
$('#file-edit-form,#file-play-video').css({height:$(window).height()-150,width:'100%','max-width':'100%',overflow:'auto'});
$('#file-play-video > video').css({height:'100%'});
for(var i=0;i<modalIds.length;i++){
App.resizeModalHeight(modalIds[i]);
}
});
$(window).trigger('resize');
$('#file-rename-modal .modal-footer .btn-primary:last').off().on('click',function(){
Expand Down
2 changes: 1 addition & 1 deletion public/assets/backend/js/behaviour/page/file.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions template/backend/filemanager/file_edit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Id : "file-edit-modal"
Custom : true
Full : true
HeadTitle : "编辑文件"
Title : ""
Animate : "none"
Expand Down
1 change: 1 addition & 0 deletions template/backend/filemanager/file_play.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Id : "file-play-modal"
Custom : true
Full : true
HeadTitle : "播放"
Title : ""
Animate : "md-dark"
Expand Down
6 changes: 3 additions & 3 deletions template/backend/modal.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{Strip}}<!-- Modal -->
{{with $.Data}}
{{- if not .HeadTitle -}}
<div class="modal{{if .Animate}} {{.Animate}}{{else}} fade{{end}}" id="{{.Id}}" tabindex="-1" role="dialog">
<div class="modal{{if .Animate}} {{.Animate}}{{else}} fade{{end}}{{if .Full}} modal-full{{end}}" id="{{.Id}}" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
Expand Down Expand Up @@ -36,13 +36,13 @@

{{- else -}}

<div class="md-modal {{if eq .ContentType "blackform"}}md-dark custom-width{{else}}colored-header{{end}} {{.Type}}{{if .Animate}} {{.Animate}}{{else}} md-effect-10{{end}}" id="{{.Id}}">
<div class="md-modal {{if eq .ContentType `blackform`}}md-dark custom-width{{else}}colored-header{{end}} {{.Type}}{{if .Animate}} {{.Animate}}{{else}} md-effect-10{{end}}{{if .Full}} md-modal-full{{end}}" id="{{.Id}}">
<div class="md-content">
<div class="modal-header">
<h3>{{.HeadTitle|$.T|ToHTML}}<span class="modal-subtitle"></span></h3>
<button type="button" class="close md-close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>
<div class="modal-body{{if or (eq .ContentType "blackform") (eq .ContentType "form")}} form{{end}}">
<div class="modal-body{{if eq .ContentType `blackform` `form`}} form{{end}}">
{{- if .Custom -}}
{{.Content|$.T|ToHTML}}
{{- else -}}
Expand Down

0 comments on commit f01a711

Please sign in to comment.