mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Move application bootstrap in Sammy run event listener.
This commit is contained in:
parent
34e10bdbd0
commit
72b3454c66
1 changed files with 28 additions and 18 deletions
|
@ -1,5 +1,33 @@
|
|||
var app = Sammy('#main', function (sam) {
|
||||
|
||||
|
||||
/**
|
||||
* Application bootstrap
|
||||
*
|
||||
*/
|
||||
sam.bind('run', function () {
|
||||
|
||||
// Fixes for sliding effect
|
||||
$('#slider-container').width(2*$('#slider').width() +'px');
|
||||
$(window).resize(function() {
|
||||
$('#slideBack').css('display', 'none');
|
||||
$('#slideTo').css('display', 'none');
|
||||
$('#slider-container').width(2*$('#slider').width() +'px').removeClass('move').css('margin-left', '0px');
|
||||
});
|
||||
|
||||
// Flash messages
|
||||
var flashMessage = $('#flashMessage');
|
||||
$('#toggle-btn', flashMessage).click(function(e) {
|
||||
flashMessage.toggleClass('open');
|
||||
});
|
||||
$('#clear-btn', flashMessage).click(function(e) {
|
||||
flashMessage.removeClass('open').find('.messages').html('');
|
||||
$('#slider').removeClass('with-flashMessage');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Sammy Configuration
|
||||
*
|
||||
|
@ -2096,22 +2124,4 @@ $(document).ready(function () {
|
|||
* Application
|
||||
*/
|
||||
app.run('#/');
|
||||
|
||||
// Fixes for sliding effect
|
||||
$('#slider-container').width(2*$('#slider').width() +'px');
|
||||
$(window).resize(function() {
|
||||
$('#slideBack').css('display', 'none');
|
||||
$('#slideTo').css('display', 'none');
|
||||
$('#slider-container').width(2*$('#slider').width() +'px').removeClass('move').css('margin-left', '0px');
|
||||
});
|
||||
|
||||
// Flash messages
|
||||
var flashMessage = $('#flashMessage');
|
||||
$('#toggle-btn', flashMessage).click(function(e) {
|
||||
flashMessage.toggleClass('open');
|
||||
})
|
||||
$('#clear-btn', flashMessage).click(function(e) {
|
||||
flashMessage.removeClass('open').find('.messages').html('');
|
||||
$('#slider').removeClass('with-flashMessage');
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue