better close modal btn position sticky, don't backhome if production modal closed

This commit is contained in:
Bachir Soussi Chiadmi
2018-04-12 22:36:23 +02:00
parent 9c6fe22012
commit e9a00903a9
4 changed files with 19 additions and 14 deletions
@@ -260,7 +260,7 @@
if($('span.close-col-btn', this).length) if($('span.close-col-btn', this).length)
return true; return true;
$(this).append($('<span>') $(this).children('.wrapper').prepend($('<span>')
.addClass('close-col-btn') .addClass('close-col-btn')
.on('click', function(e){ .on('click', function(e){
// check for theme attribute and emmit event // check for theme attribute and emmit event
@@ -271,9 +271,10 @@
} }
// remove the col // remove the col
$col.remove(); $col.remove();
// if row is empty call closeAllModals() // if row is empty and we are not in productions call closeAllModals()
if(!$('.col', _$row).length){ if(!$('.col', _$row).length
backToFrontPage(); && !_$body.is('.entity-type-node.bundle-page')){
backToFrontPage();
} }
}) })
); );
@@ -1327,14 +1327,15 @@ main[role="main"] ul, main[role="main"] li, main[role="main"] ul.inline li:first
main[role="main"] span.close-col-btn { main[role="main"] span.close-col-btn {
pointer-events: all; pointer-events: all;
cursor: pointer; cursor: pointer;
position: absolute; position: -webkit-sticky;
top: 0; position: sticky;
right: 16px; top: 0.5em;
padding: 0 !important; padding: 0 !important;
margin: 0.5em; margin: 0.5em;
display: block; display: block;
width: 10px; width: 10px;
height: 10px; height: 10px;
float: right;
background-image: url(../img/close.svg); background-image: url(../img/close.svg);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
@@ -260,7 +260,7 @@
if($('span.close-col-btn', this).length) if($('span.close-col-btn', this).length)
return true; return true;
$(this).append($('<span>') $(this).children('.wrapper').prepend($('<span>')
.addClass('close-col-btn') .addClass('close-col-btn')
.on('click', function(e){ .on('click', function(e){
// check for theme attribute and emmit event // check for theme attribute and emmit event
@@ -271,9 +271,10 @@
} }
// remove the col // remove the col
$col.remove(); $col.remove();
// if row is empty call closeAllModals() // if row is empty and we are not in productions call closeAllModals()
if(!$('.col', _$row).length){ if(!$('.col', _$row).length
backToFrontPage(); && !_$body.is('.entity-type-node.bundle-page')){
backToFrontPage();
} }
}) })
); );
@@ -266,12 +266,14 @@ main[role="main"]{
// z-index: 10; // z-index: 10;
pointer-events: all; pointer-events: all;
cursor: pointer; cursor: pointer;
position:absolute; position:sticky;
top:0; right:16px; top:0.5em;
padding:0!important; margin:0.5em; padding:0!important;
margin:0.5em;
display: block; display: block;
$s:10px; $s:10px;
width:$s; height:$s; width:$s; height:$s;
float: right;
background-image: url(../img/close.svg); background-image: url(../img/close.svg);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;