Moved body of setLayoutMode() into $.onReady

This commit is contained in:
Tobi Schäfer 2015-01-11 14:29:24 +01:00
parent 235d142b14
commit 1b687ae95d

View file

@ -16,9 +16,6 @@ require('codemirror/mode/htmlmixed/htmlmixed');
require('./cm-skin-mode'); require('./cm-skin-mode');
$(function() { $(function() {
setLayoutMode();
// Extend jQuery with selectText() method. // Extend jQuery with selectText() method.
$.fn.selectText = function() { $.fn.selectText = function() {
var element = this.get(0); var element = this.get(0);
@ -56,11 +53,7 @@ $(function() {
}); });
function setLayoutMode(mode) { // Add the skin controls for the layout sandbox
if (mode === false || $('.av-skin-control').length < 0) {
$('.av-skin-control').remove();
return;
}
/*$('body').prepend($('<div>').attr('class', 'layout-sandbox') /*$('body').prepend($('<div>').attr('class', 'layout-sandbox')
.append($('<div>') .append($('<div>')
.append($('<button>') .append($('<button>')
@ -75,13 +68,13 @@ function setLayoutMode(mode) {
href: $(this).data('href'), href: $(this).data('href'),
title: 'Click to edit ' + $(this).data('name') + ' skin' title: 'Click to edit ' + $(this).data('name') + ' skin'
}).mouseover(function() { }).mouseover(function() {
$(this).parents('.av-skin').eq(0).addClass('active'); $(this).parents('.av-skin').eq(0).addClass('av-skin-active');
}).mouseout(function() { }).mouseout(function() {
$(this).parents('.av-skin').eq(0).removeClass('active'); $(this).parents('.av-skin').eq(0).removeClass('av-skin-active');
}).html('<i class="uk-icon-pencil"></i>'); }).html('<i class="uk-icon-pencil"></i>');
$(this).prepend(skinButton); $(this).prepend(skinButton);
}); });
} });
Antville = {}; Antville = {};
Antville.prefix = 'Antville_'; Antville.prefix = 'Antville_';