From bcf95b418334059308214ea1c1546536c2ebf545 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 10 Dec 2014 14:04:59 +0200 Subject: [PATCH] Split 90-custom into 90-autoresize and 90-themes --- MANIFEST | 3 ++- js/90-autoresize.js | 20 ++++++++++++++++++++ js/{90-custom.js => 90-themes.js} | 16 ---------------- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 js/90-autoresize.js rename js/{90-custom.js => 90-themes.js} (63%) diff --git a/MANIFEST b/MANIFEST index 93228f4..b702b07 100644 --- a/MANIFEST +++ b/MANIFEST @@ -14,8 +14,9 @@ js/00-zepto.js js/01-zepto-jquery.js js/10-bootstrap-dropdown.js js/10-bootstrap-modal.js -js/90-custom.js +js/90-autoresize.js js/90-form.js +js/90-themes.js js/90-nav.js lib/Plack/App/Gruntmaster.pm lib/Plack/App/Gruntmaster/HTML.pm diff --git a/js/90-autoresize.js b/js/90-autoresize.js new file mode 100644 index 0000000..e40ef4e --- /dev/null +++ b/js/90-autoresize.js @@ -0,0 +1,20 @@ +(function(){ + 'use strict'; + + $( document ).ready(function() { + var hiddenDiv = $(document.createElement('div')); + + hiddenDiv.addClass('hiddendiv common'); + + $('body').append(hiddenDiv); + + $("textarea.autoresize").on('keyup', function () { + var content = $(this).val(); + + content = content.replace(/\n/g, '
'); + hiddenDiv.html(content + '
'); + + $(this).css('height', hiddenDiv.height()+23); + }); + }); +})(); diff --git a/js/90-custom.js b/js/90-themes.js similarity index 63% rename from js/90-custom.js rename to js/90-themes.js index 183f3dd..74506c8 100644 --- a/js/90-custom.js +++ b/js/90-themes.js @@ -7,22 +7,6 @@ $( document ).ready(function() { $('#theme-selector').removeClass('hidden'); - - var hiddenDiv = $(document.createElement('div')); - - hiddenDiv.addClass('hiddendiv common'); - - $('body').append(hiddenDiv); - - $("textarea.autoresize").on('keyup', function () { - var content = $(this).val(); - - content = content.replace(/\n/g, '
'); - hiddenDiv.html(content + '
'); - - $(this).css('height', hiddenDiv.height()+23); - }); - $('#theme_slate' ).on('click', function () { set_style("slate"); }); $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); -- 2.39.2