From 3b61ba0f29b37123207d86e6329af27c9dc7ccfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 13 Sep 2013 07:45:29 +0200 Subject: Update kosten.ls --- static/js/kosten.ls | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'static') diff --git a/static/js/kosten.ls b/static/js/kosten.ls index 5781126..0cec05f 100644 --- a/static/js/kosten.ls +++ b/static/js/kosten.ls @@ -1,17 +1,16 @@ jQuery.fn.extend do copy : -> @clone!remove-attr 'id class' -# Start jQuery context -<-! $ +jq = (f) -> $ !-> f # Add -addJS = !-> +export addJS = jq -> $ 'input[name=date]' .datepicker do dateFormat: \dd.mm.yy firstDay: 1 # Show -showJS = !-> +export showJS = jq -> $ ".detail span" .click -> $ @ .prev-all \.mark:last .click! @@ -26,7 +25,7 @@ showJS = !-> $ \.details .hide! # Categories -catsJS = !-> +export catsJS = jq -> counter = 0 add_img = $ \image#add new_input = $ \input#new @@ -34,7 +33,7 @@ catsJS = !-> new_image = (new_name) -> # we need to copy the image to get the correct URL add_img.copy! - .. .attr \src -> @src.replace \add, new_name + .. .attr \src -> @src.replace \add new_name $ "li > span" .click -> span = $ @ @@ -42,13 +41,15 @@ catsJS = !-> img = new_image \undo .. .click -> $ @ .remove! - input.fade-out \slow span.toggle + <- input.fade-out \slow + span.toggle! # reset text input.val span.text! span.toggle! - input.fade-in \slow -> $ @ .after img + <- input.fade-in \slow + img.insert-after input add_img.click -> input = new_input.copy! @@ -59,10 +60,11 @@ catsJS = !-> input.attr \name -> @name + counter .remove-attr \style - .insert-before add_img.parent! .wrap "
  • " - - input.parent! + .parent! # wrap does not return the li .append img .hide! + .insert-before add_img.parent! .fade-in \slow input.focus + + counter++ -- cgit v1.2.3