diff options
author | Marian Sigler <m@qjym.de> | 2012-09-29 18:06:33 +0200 |
---|---|---|
committer | Marian Sigler <m@qjym.de> | 2012-09-29 18:06:33 +0200 |
commit | 4df259ad5530de1167e236e529f46ecd86c63273 (patch) | |
tree | 2ee1910b2390a00fb6095c1f63e2a28c87b4364c /templates | |
parent | 2f5998a079e2a4f882c1ea3c1a3ceebca404e3a8 (diff) | |
download | web-4df259ad5530de1167e236e529f46ecd86c63273.tar.gz web-4df259ad5530de1167e236e529f46ecd86c63273.tar.bz2 web-4df259ad5530de1167e236e529f46ecd86c63273.zip |
move settings JavaScript code to own js file to not have to load it everytime
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 2 | ||||
-rw-r--r-- | templates/settings.html | 28 |
2 files changed, 2 insertions, 28 deletions
diff --git a/templates/base.html b/templates/base.html index d30fb4a..39b76aa 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,5 @@ {%- set styles = ['layout.css', 'bootstrap-form.css'] + styles|default([]) %} -{%- set scripts = ['jquery-1.8.2.min.js'] + scripts|default([]) %} +{%- set scripts = ['script.js', 'jquery-1.8.2.min.js'] + scripts|default([]) %} <!doctype html> <html> <head> <meta charset="utf-8" /> diff --git a/templates/settings.html b/templates/settings.html index 3bc5f4d..a181ccb 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -51,31 +51,5 @@ {% block javascript %} - $(document).ready(function() { - - $('.service').each(function() { - var header = $(this).find('h3'); - var list = $(this).find('ul'); - var content = $(this).find('.form-service'); - var elem = $('<a class="service-edit" href="">bearbeiten</a>') - - elem.click(function() { - content.toggle(); - - return false; - }); - - console.log(list.find('a')) - if(list.find('a').length > 0) { - list.find('a').parent().prepend(elem); - } else { - var li = $('<li></li>'); - li.append(elem); - list.append(li); - } - - content.hide(); - }); - - }); + $(document).ready(settings_service_toggle); {% endblock %} |