* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
-// Make both windows drag'n'drop-able
-$().ready(function() {
+
+// If all all has been loaded, initialize rest of it
+$().ready(function () {
// Fade default content in
window.setTimeout("requestAjaxContent('admin', 'admin_content', '$content[admin_page]', false)", 250);
$('a').each(function (i) {
$(this).on('click', {index:i}, function (event) {
// Is there a valid index?
- if (indexTranslation[event.data.index] != null) {
+ if (indexTranslation[event.data.index] !== null) {
// Prevent default action
event.preventDefault();
});
});
- //-----------------------------------------
- // Close buttons
- //-----------------------------------------
- $('#admin_error_close').click(function () {
- // Close the window
- closeErrorWindow('admin');
- });
-
- $('#admin_warning_close').click(function () {
- // Close the window
- closeWarningWindow('admin');
- });
+ // Register common things (close buttons, drag&drop)
+ registerCommons('admin');
//-----------------------------------------
// Save changes
// Save changes
saveChanges('admin');
});
-
- //-----------------------------------------
- // Drag'N'Drop
- //-----------------------------------------
- $('#admin_warning').draggable({
- opacity: 0.85
- });
-
- $('#admin_error').draggable({
- opacity: 0.85
- });
});