Fix switching of yardi logo again
[mindcoding-template-patches.git] / js / scripts.js
CommitLineData
4de434ba
MG
1function set_style(name){
2 $('#stylesheet').attr("href", "/css/" + name + ".var");
b78f93c9 3 localStorage.setItem("theme", name);
a84cee55 4
dd2a82d1 5 $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png");
4de434ba
MG
6}
7
e9902b1b
S
8$( document ).ready(function() {
9 var txt = $('#comments');
10 hiddenDiv = $(document.createElement('div')),
11 content = null;
12
13 txt.addClass('txtstuff');
14 hiddenDiv.addClass('hiddendiv common');
15
16 $('body').append(hiddenDiv);
17
18 $(".form-control").on('keyup', function () {
4de434ba 19 content = $(this).val();
e9902b1b 20
4de434ba
MG
21 content = content.replace(/\n/g, '<br>');
22 hiddenDiv.html(content + '<br class="lbr">');
e9902b1b 23
4de434ba 24 $(this).css('height', hiddenDiv.height()+23);
e9902b1b
S
25 });
26
4de434ba
MG
27 $('#theme_slate' ).on('click', function () { set_style("slate"); });
28 $('#theme_cerulean').on('click', function () { set_style("cerulean"); });
29 $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); });
88da92e7 30 $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); });
4de434ba 31});
b78f93c9 32
dd2a82d1 33if(localStorage.getItem("theme")) {
b78f93c9 34 set_style(localStorage.getItem("theme"));
dd2a82d1
MG
35 $(document).ready(function(){
36 $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png");
37 })
38}
This page took 0.011226 seconds and 4 git commands to generate.