...
assets/js/ace-extra.js
This will cause the element's status be restored as soon as it is inserted into DOM. If you call the functions after page load, for example in jQuery's document ready event, there may be a delay between the initial state and the saved state.
try/catch
block is used so that if you don't want to use ace-extra.js
,
the browser doesn't raise any errors.
.navbar-fixed-top
class
to .navbar
element:
ace.settings.navbar_fixed(null, true, true);//first parameter is null or reference to navbar element ace.settings.navbar_fixed(document.getElementById('navbar'), true, true);First parameter is a reference to navbar element. If null
#navbar
will be used.
.breadcrumbs-fixed
class
to .breadcrumbs
element:
ace.settings.breadcrumbs_fixed(null, true, true);//first parameter is null or reference to breadcrumbs element ace.settings.breadcrumbs_fixed(document.getElementById('breadcrumbs'), true, true);First parameter is a reference to breadcrumbs element. If null
#breadcrumbs
will be used.
991px
which you can change that by modifying @screen-fixed-breadcrumbs
variable
inside assets/css/less/variables.less
files and recompiling ace.less
.
.container
class
to .navbar-container
and .main-container
elements:
...
ace.settings.main_container_fixed(null, true, true);//first parameter is null or reference to container element ace.settings.main_container_fixed(document.getElementById('main-container'), true, true);First parameter is a reference to container element. If null
#main-container
will be used.
$(window).on('resize.auto_container', function() { var enable = $(this).width() > 1140; try { ace.settings.main_container_fixed(enable, false, false); } catch(e) {} }).triggerHandler('resize.auto_container');
.sidebar-fixed
class
to .sidebar
element:
ace.settings.sidebar_fixed(null, true, true);//first element is null or reference to sidebar element ace.settings.sidebar_fixed(document.getElementById('sidebar'), true, true);First parameter is a reference to sidebar element. If null
#sidebar
will be used.
.menu-min
class
to .sidebar
element:
ace.settings.sidebar_collapsed(null, true, true);//first param is null or reference to sidebar element ace.settings.sidebar_collapsed(document.getElementById('sidebar'), true, true);First parameter is a reference to sidebar element. If null,
#sidebar
will be used.
settings.ace
and
has two extra arguments.
$(document).on('settings.ace', function(event, name, status) { //name is one of the following //navbar_fixed //sidebar_fixed //breadcrumbs_fixed //main_container_fixed //sidebar_collapsed //status is either true or false if(name == 'sidebar_fixed' && status == false) { //sidebar was unfixed by user, do something } }
.no-skin
.skin-1
.skin-2
.skin-3
To use .skin-3 you should add .no-skin
class as wellbody
element's class name:
<body class="skin-2"> ...
ace.css
but for other skins you should include ace-skins.css
ace.css
using another skin.
$('#ace-settings-skin').on('change', function() { ace.settings.set('skin', this.value); })And in your server side code:
$skin = $_COOKIE['ace_skin']; echo '<body class="'.$skin.'">'; //... //... echo '<li class="'.some_modification_based_on_selected_skin($skin).'">';Of course it's the simplest way and things would be different depending on your application
assets/css/ace-rtl.css
.rtl
class to body
element-right
or -left
.pull-right
& .pull-left
.no-padding-left
& .no-padding-right
.arrowed
& .arrowed-right
.make-ltr
and .make-rtl
classes:
$('#my-content').addClass('make-ltr') .find('.scroll-content').wrapInner('<div class="make-rtl" />');Some plugins support RTL and you should specify the options when initiating plugins:
.chosen-rtl
to the elementdirection:'rtl'
optionisRTL:true
optionisRTL:true
optionace-extra.js
//cookie functions ace.cookie.set(name, value, expires, path, domain, secure); ace.cookie.get(name); ace.cookie.remove(name, path);
//localStorage functions ace.storage.set(key, value); ace.storage.get(key); ace.storage.remove(key);
ace.data_storage
is a wrapper which by default chooses localStorage if available.
ace.data = new ace.data_storage();//use localStorage if available otherwise use cookies ace.data = new ace.data_storage(1);//use localStorage ace.data = new ace.data_storage(2);//use cookies //save/load values with namespace (for example 'settings') //ace.data.set(namespace, key, value); ace.data.set('settings', 'sidebar-collapsed', 1); var collapsed = ace.data.get('settings', 'sidebar-collapsed'); ace.data.remove('settings', 'sidebar-collapsed'); //save/load values without namespace ace.data.set('username', 'alex'); var username = ace.data.get('username'); ace.data.remove('username');
.ace-settings-container
) should be the first child of
.page-content
.ace-settings-btn
and .ace-settings-box
which consists of several .ace-settings-item
elements:
. . ....