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 /static/script.js | |
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 'static/script.js')
-rw-r--r-- | static/script.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js new file mode 100644 index 0000000..f154300 --- /dev/null +++ b/static/script.js @@ -0,0 +1,27 @@ +function settings_service_toggle() { + + $('.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(); + }); + + } |