Position appsettings fixed and load it in dynamically added element.
This commit is contained in:
parent
7113e80184
commit
eb516b79b6
2 changed files with 36 additions and 34 deletions
|
@ -160,9 +160,9 @@ a.bookmarklet { background-color: #ddd; border:1px solid #ccc; padding: 5px;padd
|
||||||
#category_addinput { width: 10em; }
|
#category_addinput { width: 10em; }
|
||||||
|
|
||||||
/* ---- APP SETTINGS ---- */
|
/* ---- APP SETTINGS ---- */
|
||||||
.popup { background-color: white; border-radius: 10px 10px 10px 10px; box-shadow: 0 0 20px #888888; color: #333333; padding: 10px; position: absolute; z-index: 200; }
|
.popup { background-color: white; border-radius: 10px 10px 10px 10px; box-shadow: 0 0 20px #888888; color: #333333; padding: 10px; position: fixed !important; z-index: 200; }
|
||||||
.popup.topright { top: -8px; right: 1em; }
|
.popup.topright { top: 7em; right: 1em; }
|
||||||
.popup.bottomleft { bottom: 1em; left: 8px; }
|
.popup.bottomleft { bottom: 1em; left: 33em; }
|
||||||
.popup .close { position:absolute; top: 0.2em; right:0.2em; height: 20px; width: 20px; background:url('../img/actions/delete.svg') no-repeat center; }
|
.popup .close { position:absolute; top: 0.2em; right:0.2em; height: 20px; width: 20px; background:url('../img/actions/delete.svg') no-repeat center; }
|
||||||
.popup h2 { font-weight: bold; font-size: 1.2em; }
|
.popup h2 { font-weight: bold; font-size: 1.2em; }
|
||||||
.arrow { border-bottom: 10px solid white; border-left: 10px solid transparent; border-right: 10px solid transparent; display: block; height: 0; position: absolute; width: 0; z-index: 201; }
|
.arrow { border-bottom: 10px solid white; border-left: 10px solid transparent; border-right: 10px solid transparent; display: block; height: 0; position: absolute; width: 0; z-index: 201; }
|
||||||
|
|
|
@ -175,16 +175,21 @@ OC={
|
||||||
if(settings.length == 0) {
|
if(settings.length == 0) {
|
||||||
throw { name: 'MissingDOMElement', message: 'There has be be an element with id "appsettings" for the popup to show.' };
|
throw { name: 'MissingDOMElement', message: 'There has be be an element with id "appsettings" for the popup to show.' };
|
||||||
}
|
}
|
||||||
if(settings.is(':visible')) {
|
var popup = $('#appsettings_popup');
|
||||||
settings.hide().find('.arrow').hide();
|
if(popup.length == 0) {
|
||||||
|
$('body').prepend('<div class="popup hidden" id="appsettings_popup"></div>');
|
||||||
|
popup = $('#appsettings_popup');
|
||||||
|
popup.addClass(settings.hasClass('topright') ? 'topright' : 'bottomleft');
|
||||||
|
}
|
||||||
|
if(popup.is(':visible')) {
|
||||||
|
popup.hide().remove();
|
||||||
} else {
|
} else {
|
||||||
if($('#journal.settings').length == 0) {
|
|
||||||
var arrowclass = settings.hasClass('topright') ? 'up' : 'left';
|
var arrowclass = settings.hasClass('topright') ? 'up' : 'left';
|
||||||
var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function(data) {
|
var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function(data) {
|
||||||
$('#appsettings').html(data).ready(function() {
|
popup.html(data).ready(function() {
|
||||||
settings.prepend('<span class="arrow '+arrowclass+'"></span><h2>'+t('core', 'Settings')+'</h2><a class="close svg"></a>').show();
|
popup.prepend('<span class="arrow '+arrowclass+'"></span><h2>'+t('core', 'Settings')+'</h2><a class="close svg"></a>').show();
|
||||||
settings.find('.close').bind('click', function() {
|
popup.find('.close').bind('click', function() {
|
||||||
settings.hide();
|
popup.remove();
|
||||||
})
|
})
|
||||||
if(typeof props.loadJS !== 'undefined') {
|
if(typeof props.loadJS !== 'undefined') {
|
||||||
var scriptname;
|
var scriptname;
|
||||||
|
@ -203,11 +208,8 @@ OC={
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}).show();
|
||||||
}, 'html');
|
}, 'html');
|
||||||
} else {
|
|
||||||
settings.show().find('.arrow').show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue