Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal Fixes #668

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/client/assets/sass/layouts/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ body.zen {
/* =============================================================================
Markdown Help Modal
============================================================================= */

.markdown-help-container{
padding-bottom: 20px;
}
.modal-markdown-help-table {
margin-top: 0;
}
Expand Down
137 changes: 82 additions & 55 deletions core/client/assets/sass/modules/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -984,32 +984,42 @@ nav {
Modals
========================================================================== */
#modal-container {
&.active {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
@include transition(all 0.15s linear 0s);
@include transform(translateZ(0));

&.dark {
background: rgba(0,0,0,0.4);
}
@include box-sizing(border-box);
display: none;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow-x: auto;
overflow-y: scroll;
z-index: 1040;
pointer-events: none;
@include transition(all 0.15s linear 0s);
@include transform(translateZ(0));
}

.modal-background {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
}
.fade {
opacity: 0;
@include transition(opacity 0.2s linear 0s);
@include transform(translateZ(0));

&.in {
opacity: 1;
}
}

.modal-background {
display: none;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.4);
z-index: 1030;
}

body.blur > *:not(#modal-container) {
@include transition(all 0.15s linear 0s);
-webkit-filter: blur(2px);
Expand All @@ -1022,30 +1032,29 @@ body.blur > *:not(#modal-container) {

%modal, .modal {
@include box-sizing(border-box);
max-height: 90%;
left: 50%;
right: auto;
width: 450px;
padding: 0;
background: #fff;
border-radius: $rounded;
overflow:auto;
z-index: 1001;
box-shadow: rgba(0,0,0,0.2) 0 0 0 6px;
margin-left: auto;
margin-right: auto;
padding-top: 30px;
padding-bottom: 30px;
z-index: 1050;
pointer-events: auto;

&.fade {
opacity: 0;
@include transition(opacity 0.2s linear 0s);

&.in {
opacity: 1;
}
}
@include breakpoint($tablet) {
width: auto;
padding: 10px;
};

button {
min-width: 100px;
}

@include breakpoint($mobile) {
@include breakpoint($tablet) {
width: 100%;
margin-left: 0;
}
}

Expand All @@ -1055,48 +1064,63 @@ body.blur > *:not(#modal-container) {

.modal-action {
@extend %modal;
padding: 60px 0 30px;

@include breakpoint($tablet) {
padding: 30px 0;
}

.modal-footer {
margin-top: 20px;
}
}

.modal-header {
.modal-content {
@include box-sizing(padding-box);
position: relative;
padding: 20px;
border-bottom: 1px solid $lightgrey;

h1 {
display: inline-block;
margin: 0;
font-size: 1.5em;
font-weight: bold;
}
background-clip: padding-box;
background-color: #FFFFFF;
border-radius: $rounded;
box-shadow: rgba(0,0,0,0.2) 0 0 0 6px;

.close {
@include box-sizing(border-box);
position: absolute;
top: 10px;
right: 20px;
top: 15px;
right: 15px;
width: 16px;
min-height: 16px;
padding: 0;
margin: 0;
border: none;
opacity: 0.4;
z-index: 9999;

@include icon($i-close, 1em, $midgrey);
@include icon($i-x, 1em, $midgrey);
@include transition(opacity 0.3s linear);

&:hover{
opacity: 1;
&:hover {
color: $darkgrey;
}
}
}
.modal-header {
position: relative;
padding: 20px;
border-bottom: 1px solid $lightbrown;

.modal-content {
padding: 0 20px;
h1 {
display: inline-block;
margin: 0;
font-size: 1.5em;
font-weight: bold;
}
}

.modal-body {
position: relative;
min-height: 100px;
padding: 0 20px;
overflow-y: auto;
}

.modal-footer {
Expand All @@ -1107,7 +1131,7 @@ body.blur > *:not(#modal-container) {
.modal-style-wide {
width: 550px;

@include breakpoint($mobile) {
@include breakpoint($tablet) {
width: 100%;
}
}
Expand Down Expand Up @@ -1322,6 +1346,9 @@ main {
}
}

.modal-content .pre-image-uploader, .modal-content .image-uploader {
margin: 20px 0 0 0;
}
.pre-image-uploader {
@include box-sizing(border-box);
@include baseline;
Expand Down
1 change: 0 additions & 1 deletion core/client/markdown-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
}

$(".modal-copyToHTML-content").text(md).selectText();
$(".js-modal").center();
pass = false;
break;
case "list":
Expand Down
6 changes: 3 additions & 3 deletions core/client/models/uploadModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Ghost.Models.uploadModal = Backbone.Model.extend({

options: {
close: false,
close: true,
type: "action",
style: "wide",
animation: 'fadeIn',
style: ["wide"],
animation: 'fade',
afterRender: function () {
this.$('.js-drop-zone').upload();
},
Expand Down
18 changes: 10 additions & 8 deletions core/client/tpl/modal.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<aside class="modal-background"></aside>
<article class="modal{{#if options.type}}-{{options.type}}{{/if}} {{#if options.style}}{{#each options.style}}modal-style-{{this}} {{/each}}{{/if}}{{options.animation}} js-modal">
{{#if content.title}}<header class="modal-header"><h1>{{content.title}}</h1>{{#if options.close}}<a class="close" href="#"><span class="hidden">Close</span></a>{{/if}}</header>{{/if}}
<section class="modal-content">
{{#if content.title}}<header class="modal-header"><h1>{{content.title}}</h1></header>{{/if}}
{{#if options.close}}<a class="close" href="#"><span class="hidden">Close</span></a>{{/if}}
<section class="modal-body">
</section>
{{#if options.confirm}}
<footer class="modal-footer">
<button class="js-button-accept {{#if options.confirm.accept.buttonClass}}{{options.confirm.accept.buttonClass}}{{else}}button-add{{/if}}">{{options.confirm.accept.text}}</button>
<button class="js-button-reject {{#if options.confirm.reject.buttonClass}}{{options.confirm.reject.buttonClass}}{{else}}button-delete{{/if}}">{{options.confirm.reject.text}}</button>
</footer>
{{/if}}
</section>
{{#if options.confirm}}
<footer class="modal-footer">
<button class="js-button-accept {{#if options.confirm.accept.buttonClass}}{{options.confirm.accept.buttonClass}}{{else}}button-add{{/if}}">{{options.confirm.accept.text}}</button>
<button class="js-button-reject {{#if options.confirm.reject.buttonClass}}{{options.confirm.reject.buttonClass}}{{else}}button-delete{{/if}}">{{options.confirm.reject.text}}</button>
</footer>
{{/if}}
</article>
Loading