Browse Source
There is little built into Caveman when it comes to JavaScript so the code here is just a walk-through on adding JQuery to app.html (the base template the others extend/inherit from). Note the use of the '/js' directory in '/static/js'. I originally use /scripts, instead of /js but Caveman did not recognise it. It looks like you need to stick with /js for the JavaScript files.master
Craig Oates
2 years ago
5 changed files with 10904 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||||
|
$(document).ready(function(){ |
||||||
|
var cb = $("#no-expiration"); |
||||||
|
var field = $("#article-expired-at"); |
||||||
|
|
||||||
|
var changeExpiredAt = function(){ |
||||||
|
if (cb.prop("checked")) |
||||||
|
field.hide(); |
||||||
|
else |
||||||
|
field.show(); |
||||||
|
}; |
||||||
|
|
||||||
|
cb.bind("click", changeExpiredAt); |
||||||
|
|
||||||
|
changeExpiredAt(); |
||||||
|
}); |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue