summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/abmahn.js41
1 files changed, 27 insertions, 14 deletions
diff --git a/js/abmahn.js b/js/abmahn.js
index 7261173..811e495 100644
--- a/js/abmahn.js
+++ b/js/abmahn.js
@@ -23,19 +23,19 @@ function getCheck(id) {
23 return document.getElementById(id).checked; 23 return document.getElementById(id).checked;
24} 24}
25 25
26function scrollTo(el) { 26function scrollTo(end) {
27 if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { 27 if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) {
28 el.scrollIntoView(); 28 window.scroll(0, end);
29 return; 29 return;
30 } 30 }
31 var duration = 500; 31 var duration = 500;
32 var start = window.pageYOffset; 32 var start = window.pageYOffset;
33 var end = document.getElementById(el).getBoundingClientRect().top + window.pageYOffset; 33// var end = document.getElementById(el).getBoundingClientRect().top + window.pageYOffset;
34 34
35 var clock = Date.now(); 35 var clock = Date.now();
36 var requestAnimationFrame = window.requestAnimationFrame || 36 var requestAnimationFrame = window.requestAnimationFrame ||
37 window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || 37 window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
38 function(fn){window.setTimeout(fn, 15);}; 38 function(fn){window.setTimeout(fn, 10);};
39 39
40 var step = function(){ 40 var step = function(){
41 var elapsed = Date.now() - clock; 41 var elapsed = Date.now() - clock;
@@ -54,14 +54,27 @@ function scrollTo(el) {
54 step(); 54 step();
55} 55}
56 56
57function step0_cancel() { scrollTo(0); setClass('wrapper', 'stepcancel'); }
58function step0_done() { scrollTo(0); setClass('wrapper', 'step1'); }
59function step1_done() { scrollTo(103); setClass('wrapper', 'step2'); }
60function step2_done() { scrollTo(196); setClass('wrapper', 'step3'); }
61function step3_done() { scrollTo(289); setClass('wrapper', 'step4'); }
62function step4_done() { scrollTo(382); setClass('wrapper', 'step5'); }
63function step5_done() { scrollTo(475); setClass('wrapper', 'step6'); }
64function step6_done() { scrollTo(568); setClass('wrapper', 'step7'); }
65function step7_done() { scrollTo(661); setClass('wrapper', 'step8'); }
66
67/*
57function step0_cancel() { setClass('wrapper', 'stepcancel'); } 68function step0_cancel() { setClass('wrapper', 'stepcancel'); }
58function step0_done() { setClass('wrapper', 'step1'); scrollTo('head1'); } 69function step0_done() { scrollTo('head1'); setClass('wrapper', 'step1'); }
59function step1_done() { setClass('wrapper', 'step2'); scrollTo('head1'); } 70function step1_done() { scrollTo('head1'); setClass('wrapper', 'step2'); }
60function step2_done() { setClass('wrapper', 'step3'); scrollTo('head2'); } 71function step2_done() { scrollTo('head2'); setClass('wrapper', 'step3'); }
61function step3_done() { setClass('wrapper', 'step4'); scrollTo('head3'); } 72function step3_done() { scrollTo('head3'); setClass('wrapper', 'step4'); }
62function step4_done() { setClass('wrapper', 'step5'); scrollTo('head4'); } 73function step4_done() { scrollTo('head4'); setClass('wrapper', 'step5'); }
63function step5_done() { setClass('wrapper', 'step6'); scrollTo('head5'); } 74function step5_done() { scrollTo('head5'); setClass('wrapper', 'step6'); }
64function step6_done() { setClass('wrapper', 'step7'); scrollTo('head6'); } 75function step6_done() { scrollTo('head6'); setClass('wrapper', 'step7'); }
76function step7_done() { scrollTo('head7'); setClass('wrapper', 'step8'); }
77*/
65 78
66function waldorf() { 79function waldorf() {
67 setText('abmahnender_kanzlei', 'Waldorf & Frommer RAe'); 80 setText('abmahnender_kanzlei', 'Waldorf & Frommer RAe');
@@ -143,7 +156,7 @@ function ausfuellen() {
143 setText('abgemahnter_plz', '10999') 156 setText('abgemahnter_plz', '10999')
144 setText('abgemahnter_ort', 'Berlin'); 157 setText('abgemahnter_ort', 'Berlin');
145 158
146 setText('abmahnender_kanzlei', 'Waldorff & Frommer'); 159 setText('abmahnender_kanzlei', 'Waldorf & Frommer');
147 setText('abmahnender_bearbeiter', 'Horst Müller'); 160 setText('abmahnender_bearbeiter', 'Horst Müller');
148 setText('abmahnender_strasse', 'Beethovenstraße 12'); 161 setText('abmahnender_strasse', 'Beethovenstraße 12');
149 setText('abmahnender_plz', '80336'); 162 setText('abmahnender_plz', '80336');
@@ -317,5 +330,5 @@ function abmahnbeantworter() {
317 pdfMake.createPdf(docDefinition).download('Abmahnung-' + getText('vorgang_aktenzeichen') + '.pdf'); 330 pdfMake.createPdf(docDefinition).download('Abmahnung-' + getText('vorgang_aktenzeichen') + '.pdf');
318 331
319 // advance view 332 // advance view
320 step6_done(); 333 step7_done();
321} 334}