bhf 0.5.12 → 0.5.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d22fb1c571702c5ec8bcd9e53654e5d8c7c194cb
4
- data.tar.gz: f03295ff3c82fada565a3ebda0c8148329b240a4
3
+ metadata.gz: 935bc1f41ce1c4d48236e2957871bab97678b03a
4
+ data.tar.gz: e2a223ef1b771a990f5817411fb721ecef0d68fb
5
5
  SHA512:
6
- metadata.gz: 36d21b4779d8195b9b4299cc0ed829f4c8d3b0e2b5544ceb07455d7db7237051f29fce8ebb85819e4e02d9d3c220d070b794e63485acf8dabd56fd2b66f64f52
7
- data.tar.gz: 63f28dd3edc312e8bb8fff03da5594735e0ac1970530fa1950464457eeaac8e1aba21cefc26c9117a723e92435b7d72a5764995f08ac24cce80fd86dc65b5792
6
+ metadata.gz: 375a0df88ac376813fac7a275c99dabffdeb6084b0aa789661dfe80191655330c2acb40722229caff73c2a1a7d7d6c239a203590ec7affa4cd2a7c9adc8846a4
7
+ data.tar.gz: 11fef397840dd2173ef7bd51b24ac50b9f1c1c502db38faee9a87bb2fed531425bcddf27535f6789c3e4a6f06031a1e03c77ec49884e48140f5a9ca12bce4e23
@@ -1,14 +1,6 @@
1
1
  - if @start_time
2
- %p.stats= "Page rendered in ~#{(Time.now-@start_time).round(2)} seconds"
2
+ %p.state= I18n.t('bhf.footer.state', time: (Time.now-@start_time).round(2)).html_safe
3
3
 
4
- %p.copy
5
- Made by
6
- = link_to '@antpaw', 'http://twitter.com/antpaw'
7
- with
8
- = link_to 'Rails 3', 'http://twitter.com/antpaw'
9
- and
10
- = link_to 'MooTools', 'http://mootools.net/'
4
+ %p.copy= I18n.t('bhf.footer.copy').html_safe
11
5
 
12
- %p.info
13
- More information on
14
- = link_to 'GitHub', 'http://github.com/antpaw/bahnhof/'
6
+ %p.info= I18n.t('bhf.footer.info').html_safe
@@ -26,3 +26,5 @@
26
26
  %footer
27
27
  = render 'bhf/user'
28
28
  = render 'bhf/footer'
29
+
30
+ =# yield :js_inject
@@ -53,6 +53,12 @@ de:
53
53
  other: "Es werden <strong>alle %{count}</strong> %{name_plural} angezeigt"
54
54
  one: "Es wird <strong>1</strong> %{name_singular} angezeigt"
55
55
  zero: "Es wurde nichts gefunden"
56
+
57
+ footer:
58
+ state: 'Seite wurde in ~%{time} Sekunden erstellt'
59
+ copy: 'Gemacht von <a href="http://twitter.com/antpaw">@antpaw</a> mit <a href="http://rubyonrails.org">Rails</a> und <a href="http://mootools.net">MooTools</a>'
60
+ info: 'Mehr Information auf <a href="http://github.com/antpaw/bhf">GitHub</a>'
61
+
56
62
  activerecord:
57
63
  notices:
58
64
  messages:
@@ -63,6 +63,11 @@ en:
63
63
  one: "Displaying <strong>1</strong> %{name_singular}"
64
64
  zero: "No %{name_zero} found"
65
65
 
66
+ footer:
67
+ state: 'Page rendered in ~%{time} seconds'
68
+ copy: 'Made by <a href="http://twitter.com/antpaw">@antpaw</a> with <a href="http://rubyonrails.org">Rails</a> and <a href="http://mootools.net">MooTools</a>'
69
+ info: 'More information on <a href="http://github.com/antpaw/bhf">GitHub</a>'
70
+
66
71
  attributes:
67
72
  _id: 'id'
68
73
 
@@ -1,342 +1,326 @@
1
1
  //= require ./mootools-core-1.4.5-full-compat.js
2
2
  //= require ./mootools-more-1.4.0.1.js
3
3
  //= require ./mootools_ujs_ap
4
- //= require turbolinks
5
4
  //= require_tree ./classes/
6
5
  var ajaxNote = new Ajaxify();
7
- var pageSetup = function(){
8
- var quickEdit;
9
- window.addEvent('domready', function(){
10
- ajaxNote.setup();
11
- var lang = document.html.get('lang');
12
- if (lang === 'en') {
13
- lang = 'en-US';
14
- }
15
- else {
16
- lang = lang+'-'+lang.toUpperCase();
17
- }
18
- Locale.use(lang);
19
- var wysiwyg = [];
20
- var setupJsForm = function(scope){
21
- scope.getElements('.wysiwyg').each(function(elem){
22
- wysiwyg.push(elem.mooEditable());
23
- });
6
+ var quickEdit;
7
+ window.addEvent('domready', function(){
8
+ ajaxNote.setup();
9
+ var lang = document.html.get('lang');
10
+ if (lang === 'en') {
11
+ lang = 'en-US';
12
+ }
13
+ else {
14
+ lang = lang+'-'+lang.toUpperCase();
15
+ }
16
+ Locale.use(lang);
17
+ var wysiwyg = [];
18
+ var setupJsForm = function(scope){
19
+ scope.getElements('.wysiwyg').each(function(elem){
20
+ wysiwyg.push(elem.mooEditable());
21
+ });
22
+
23
+ scope.getElements('.multiple_field').each(function(elem){
24
+ new MultipleFields(elem);
25
+ });
26
+ scope.getElements('.array_holder').each(function(elem){
27
+ new ArrayFields(elem);
28
+ });
29
+
30
+ scope.getElements('.picker').each(function(input){
31
+ var options = {
32
+ timePicker: true,
33
+ format: '%B %d, %Y %H:%M'
34
+ };
35
+ if (input.hasClass('date')) {
36
+ options = {
37
+ timePicker: false,
38
+ format: '%B %d, %Y'
39
+ };
40
+ }
41
+ else if (input.hasClass('time')) {
42
+ options = {
43
+ pickOnly: 'time',
44
+ format: '%H:%M'
45
+ };
46
+ }
24
47
 
25
- scope.getElements('.multiple_field').each(function(elem){
26
- new MultipleFields(elem);
27
- });
28
- scope.getElements('.array_holder').each(function(elem){
29
- new ArrayFields(elem);
30
- });
48
+ var hiddenInput = input.clone();
49
+ input.value = new Date().parse(input.value).format(options.format);
50
+ input.erase('name');
51
+ hiddenInput.set('type', 'hidden').inject(input, 'after');
31
52
 
32
- scope.getElements('.picker').each(function(input){
33
- var options = {
34
- timePicker: true,
35
- format: '%B %d, %Y %H:%M'
36
- };
37
- if (input.hasClass('date')) {
38
- options = {
39
- timePicker: false,
40
- format: '%B %d, %Y'
41
- };
53
+ new Picker.Date(input, Object.merge({
54
+ onSelect: function(date){
55
+ hiddenInput.value = date.format('db');
42
56
  }
43
- else if (input.hasClass('time')) {
44
- options = {
45
- pickOnly: 'time',
46
- format: '%H:%M'
47
- };
48
- }
49
-
50
- var hiddenInput = input.clone();
51
- input.value = new Date().parse(input.value).format(options.format);
52
- input.erase('name');
53
- hiddenInput.set('type', 'hidden').inject(input, 'after');
54
-
55
- new Picker.Date(input, Object.merge({
56
- onSelect: function(date){
57
- hiddenInput.value = date.format('db');
58
- }
59
- }, options));
60
- });
57
+ }, options));
58
+ });
59
+
60
+ scope.getElements('.wmd_editor').each(function(mdTa){
61
+ var headline, toggleHtmlPreview, toggleLivePreview, livePreview, htmlPreview;
61
62
 
62
- scope.getElements('.wmd_editor').each(function(mdTa){
63
- var headline, toggleHtmlPreview, toggleLivePreview, livePreview, htmlPreview;
64
-
65
- var togglePreview = function(e){
66
- var htmlMode = e.target.hasClass('toggle_html_preview');
67
- livePreview.toggleClass('hide', htmlMode);
68
- htmlPreview.toggleClass('hide', !htmlMode);
69
- toggleLivePreview.toggleClass('active', !htmlMode);
70
- toggleHtmlPreview.toggleClass('active', htmlMode);
71
- };
72
-
73
- headline = new Element('h6.preview_switch', {text: 'Preview'});
74
-
75
- toggleHtmlPreview = new Element('span.toggle_html_preview', {text: 'HTML'})
76
- .addEvent('click', togglePreview)
77
- .inject(headline);
78
- toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
79
- .addEvent('click', togglePreview)
80
- .inject(headline);
63
+ var togglePreview = function(e){
64
+ var htmlMode = e.target.hasClass('toggle_html_preview');
65
+ livePreview.toggleClass('hide', htmlMode);
66
+ htmlPreview.toggleClass('hide', !htmlMode);
67
+ toggleLivePreview.toggleClass('active', !htmlMode);
68
+ toggleHtmlPreview.toggleClass('active', htmlMode);
69
+ };
70
+
71
+ headline = new Element('h6.preview_switch', {text: 'Preview'});
72
+
73
+ toggleHtmlPreview = new Element('span.toggle_html_preview', {text: 'HTML'})
74
+ .addEvent('click', togglePreview)
75
+ .inject(headline);
76
+ toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
77
+ .addEvent('click', togglePreview)
78
+ .inject(headline);
81
79
 
82
- headline.inject(mdTa, 'after');
83
-
84
- livePreview = new Element('div.wmd-preview.hide').inject(headline, 'after');
85
- htmlPreview = new Element('div.wmd-output.hide').inject(livePreview, 'after');
86
-
87
- new WMDEditor({
88
- input: mdTa,
89
- button_bar: new Element('div').inject(mdTa, 'before'),
90
- preview: livePreview,
91
- output: htmlPreview,
92
- buttons: 'bold italic link image ol ul heading hr undo redo help',
93
- modifierKeys: false,
94
- autoFormatting: false
80
+ headline.inject(mdTa, 'after');
81
+
82
+ livePreview = new Element('div.wmd-preview.hide').inject(headline, 'after');
83
+ htmlPreview = new Element('div.wmd-output.hide').inject(livePreview, 'after');
84
+
85
+ new WMDEditor({
86
+ input: mdTa,
87
+ button_bar: new Element('div').inject(mdTa, 'before'),
88
+ preview: livePreview,
89
+ output: htmlPreview,
90
+ buttons: 'bold italic link image ol ul heading hr undo redo help',
91
+ modifierKeys: false,
92
+ autoFormatting: false
93
+ });
94
+ });
95
+
96
+ scope.getElements('.map_data_lat').each(function(lat){
97
+ new Setlatlng(lat);
98
+ });
99
+ };
100
+
101
+ // TODO: disable more ajax calls while ajax is loading
102
+ quickEdit = new AjaxEdit({
103
+ holderParent: $('content'),
104
+ onStartRequest: function(form){
105
+ ajaxNote.loading();
106
+ },
107
+ onFormInjected: function(form){
108
+ setupJsForm(form);
109
+ scrollContent();
110
+ ajaxNote.success();
111
+ },
112
+ onSave: function(form){
113
+ ajaxNote.success();
114
+ },
115
+ onBeforeSubmit: function(){
116
+ ajaxNote.loading();
117
+ wysiwyg.each(function(elem){
118
+ elem.saveContent();
119
+ });
120
+ }
121
+ });
122
+
123
+ var platforms = document.body.getElements('.platform');
124
+ var mainForm = document.id('main_form');
125
+
126
+ if (platforms.length) {
127
+ var setupSortables = function(scope){
128
+ scope.getElements('.sortable').each(function(sortableElems){
129
+ new Sortables(sortableElems, {
130
+ handle: '.handle',
131
+ onStart: function(element, clone){
132
+ element.addClass('dragged');
133
+ },
134
+ onComplete: function(element){
135
+ element.removeClass('dragged');
136
+ new Request({
137
+ method: 'put',
138
+ url: this.element.getParent('tbody').get('data-sort-url')
139
+ }).send({data: {order: this.serialize()}});
140
+ }
95
141
  });
96
142
  });
97
-
98
- scope.getElements('.map_data_lat').each(function(lat){
99
- new Setlatlng(lat);
100
- });
143
+ };
144
+ var updatePlatform = function(href, platform, callback){
145
+ ajaxNote.loading();
146
+ new Request.HTML({
147
+ method: 'get',
148
+ url: href,
149
+ onSuccess: function(a, b, html, js){
150
+ platform.innerHTML = html;
151
+ if (callback) {
152
+ callback.call();
153
+ }
154
+ setupSortables(platform);
155
+ Browser.exec(js);
156
+ ajaxNote.success();
157
+ windowHight = document.body.clientHeight;
158
+ }
159
+ }).send();
101
160
  };
102
161
 
103
- // TODO: disable more ajax calls while ajax is loading
104
- quickEdit = new AjaxEdit({
105
- holderParent: $('content'),
106
- onStartRequest: function(form){
162
+ platforms.addEvents({
163
+ 'click:relay(.pagination a, thead a)': function(e){
164
+ e.preventDefault();
165
+ updatePlatform(this.get('href'), this.getParent('.platform'));
166
+ },
167
+ 'submit:relay(.search)': function(e){
107
168
  ajaxNote.loading();
169
+ e.preventDefault();
170
+ var parent = this.getParent('.platform');
171
+ var hidden_search = e.target.getElement('.hidden_search');
172
+ if (hidden_search) {
173
+ hidden_search.destroy();
174
+ }
175
+
176
+ new Request.HTML({
177
+ method: 'get',
178
+ url: this.get('action'),
179
+ onSuccess: function(a, b, html){
180
+ parent.innerHTML = html;
181
+ setupSortables(parent);
182
+ ajaxNote.success();
183
+ }
184
+ }).send({data: this});
108
185
  },
109
- onFormInjected: function(form){
110
- setupJsForm(form);
111
- scrollContent();
112
- ajaxNote.success();
186
+ 'click:relay(.quick_edit)': function(e){
187
+ e.preventDefault();
188
+ quickEdit.startEdit(this, this.getParent('tr'));
113
189
  },
114
- onSave: function(form){
115
- ajaxNote.success();
190
+ 'click:relay(.action a)': function(e){
191
+ this.addClass('clicked');
116
192
  },
117
- onBeforeSubmit: function(){
118
- ajaxNote.loading();
119
- wysiwyg.each(function(elem){
120
- elem.saveContent();
193
+ 'click:relay(.delete)': function(e){
194
+ e.target.addEvents({
195
+ 'ajax:success': function(html){
196
+ this.getParent('tr').dispose();
197
+ },
198
+ 'ajax:failure': function(html){
199
+ alert('Something went wrong!');
200
+ }
121
201
  });
122
202
  }
123
203
  });
124
204
 
125
- var platforms = document.body.getElements('.platform');
126
- var mainForm = document.id('main_form');
127
-
128
- if (platforms.length) {
129
- var setupSortables = function(scope){
130
- scope.getElements('.sortable').each(function(sortableElems){
131
- new Sortables(sortableElems, {
132
- handle: '.handle',
133
- onStart: function(element, clone){
134
- element.addClass('dragged');
135
- },
136
- onComplete: function(element){
137
- element.removeClass('dragged');
138
- new Request({
139
- method: 'put',
140
- url: this.element.getParent('tbody').get('data-sort-url')
141
- }).send({data: {order: this.serialize()}});
142
- }
143
- });
205
+ quickEdit.addEvents({
206
+ successAndChange: function(json){
207
+ var tr = this.wrapElement;
208
+ tr.getElements('td').each(function(td){
209
+ var name = td.get('data-column-name');
210
+ if ( ! name) { return; }
211
+ var a = td.getElement('a.quick_edit');
212
+ (a ? a : td).innerHTML = json[name] || '';
144
213
  });
145
- };
146
- var updatePlatform = function(href, platform, callback){
147
- ajaxNote.loading();
148
- new Request.HTML({
149
- method: 'get',
150
- url: href,
151
- onSuccess: function(a, b, html, js){
152
- platform.innerHTML = html;
153
- if (callback) {
154
- callback.call();
155
- }
156
- setupSortables(platform);
157
- Browser.exec(js);
158
- ajaxNote.success();
159
- windowHight = document.body.clientHeight;
160
- }
161
- }).send();
162
- };
163
-
164
- platforms.addEvents({
165
- 'click:relay(.pagination a, thead a)': function(e){
166
- e.preventDefault();
167
- updatePlatform(this.get('href'), this.getParent('.platform'));
168
- },
169
- 'submit:relay(.search)': function(e){
170
- ajaxNote.loading();
171
- e.preventDefault();
172
- var parent = this.getParent('.platform');
173
- var hidden_search = e.target.getElement('.hidden_search');
174
- if (hidden_search) {
175
- hidden_search.destroy();
176
- }
214
+ },
215
+ successAndNext: function(json){
216
+ var tr = this.wrapElement;
217
+ var nextTr = tr.getNext('tr');
177
218
 
178
- new Request.HTML({
179
- method: 'get',
180
- url: this.get('action'),
181
- onSuccess: function(a, b, html){
182
- parent.innerHTML = html;
183
- setupSortables(parent);
184
- ajaxNote.success();
185
- }
186
- }).send({data: this});
187
- },
188
- 'click:relay(.quick_edit)': function(e){
189
- e.preventDefault();
190
- quickEdit.startEdit(this, this.getParent('tr'));
191
- },
192
- 'click:relay(.action a)': function(e){
193
- this.addClass('clicked');
194
- },
195
- 'click:relay(.delete)': function(e){
196
- e.target.addEvents({
197
- 'ajax:success': function(html){
198
- this.getParent('tr').dispose();
199
- },
200
- 'ajax:failure': function(html){
201
- alert('Something went wrong!');
202
- }
203
- });
219
+ if (nextTr) {
220
+ quickEdit.startEdit(nextTr.getElement('a'), nextTr);
204
221
  }
205
- });
206
-
207
- quickEdit.addEvents({
208
- successAndChange: function(json){
209
- var tr = this.wrapElement;
210
- tr.getElements('td').each(function(td){
211
- var name = td.get('data-column-name');
212
- if ( ! name) { return; }
213
- var a = td.getElement('a.quick_edit');
214
- (a ? a : td).innerHTML = json[name] || '';
215
- });
216
- },
217
- successAndNext: function(json){
218
- var tr = this.wrapElement;
219
- var nextTr = tr.getNext('tr');
220
-
221
- if (nextTr) {
222
- quickEdit.startEdit(nextTr.getElement('a'), nextTr);
222
+ else {
223
+ var platform = tr.getParent('.platform');
224
+ var loadMore = platform.getElement('.load_more');
225
+ if (loadMore) {
226
+ trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
227
+ updatePlatform(loadMore.get('href'), platform, function(){
228
+ platform.getElements('tbody tr').each(function(newTr, index){
229
+ if (trIndex === index) {
230
+ nextTr = newTr.getNext('tr');
231
+ quickEdit.startEdit(nextTr.getElement('a'), nextTr);
232
+ }
233
+ });
234
+ });
223
235
  }
224
236
  else {
225
- var platform = tr.getParent('.platform');
226
- var loadMore = platform.getElement('.load_more');
227
- if (loadMore) {
228
- trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
229
- updatePlatform(loadMore.get('href'), platform, function(){
230
- platform.getElements('tbody tr').each(function(newTr, index){
231
- if (trIndex === index) {
232
- nextTr = newTr.getNext('tr');
233
- quickEdit.startEdit(nextTr.getElement('a'), nextTr);
234
- }
235
- });
236
- });
237
- }
238
- else {
239
- nextTr = platform.getElements('tbody tr')[0];
240
- quickEdit.startEdit(nextTr.getElement('a'), nextTr);
241
- }
237
+ nextTr = platform.getElements('tbody tr')[0];
238
+ quickEdit.startEdit(nextTr.getElement('a'), nextTr);
242
239
  }
243
240
  }
244
- });
245
- setupSortables(document.body);
246
- }
247
- else if (mainForm) {
248
- setupJsForm(mainForm);
241
+ }
242
+ });
243
+ setupSortables(document.body);
244
+ }
245
+ else if (mainForm) {
246
+ setupJsForm(mainForm);
249
247
 
250
- mainForm.addEvents({
251
- 'click:relay(.quick_edit)': function(e){
252
- e.preventDefault();
253
- quickEdit.startEdit(this);
254
- },
255
- 'click:relay(.delete)': function(e){
256
- e.target.addEvents({
257
- 'ajax:success': function(html){
258
- var relation = e.target.getParent('.relation');
259
- if (relation.getElements('li').length < 2) {
260
- relation.getPrevious('.empty').removeClass('hide');
261
- if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
262
- relation.getNext('.add_field').removeClass('hide');
263
- }
248
+ mainForm.addEvents({
249
+ 'click:relay(.quick_edit)': function(e){
250
+ e.preventDefault();
251
+ quickEdit.startEdit(this);
252
+ },
253
+ 'click:relay(.delete)': function(e){
254
+ e.target.addEvents({
255
+ 'ajax:success': function(html){
256
+ var relation = e.target.getParent('.relation');
257
+ if (relation.getElements('li').length < 2) {
258
+ relation.getPrevious('.empty').removeClass('hide');
259
+ if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
260
+ relation.getNext('.add_field').removeClass('hide');
264
261
  }
265
- e.target.getParent('li').dispose();
266
- },
267
- 'ajax:failure': function(html){
268
- alert('Something went wrong!');
269
262
  }
270
- });
271
- }
272
- });
273
-
274
- quickEdit.addEvents({
275
- successAndAdd: function(json){
276
- var relation = this.wrapElement.getPrevious('.relation');
277
- relation.getPrevious('.empty').addClass('hide');
278
- if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
279
- relation.getNext('.add_field').addClass('hide');
263
+ e.target.getParent('li').dispose();
264
+ },
265
+ 'ajax:failure': function(html){
266
+ alert('Something went wrong!');
280
267
  }
281
- relation.adopt(
282
- new Element('li').adopt(
283
- new Element('a.quick_edit', {text: json.to_bhf_s || '', href: json.edit_path})
284
- )
285
- );
286
- },
287
- successAndChange: function(json){
288
- this.wrapElement.set('text', json.to_bhf_s || '');
289
- },
290
- successAndNext: function(json){
291
- var a = this.wrapElement;
292
- var li = a.getParent('li');
293
- if ( ! li) {
294
- this.close();
295
- return;
296
- }
297
- var holder = li.getNext('li');
268
+ });
269
+ }
270
+ });
298
271
 
299
- if ( ! holder) {
300
- holder = li.getParent('ul');
301
- }
302
- quickEdit.startEdit(holder.getElement('a'));
272
+ quickEdit.addEvents({
273
+ successAndAdd: function(json){
274
+ var relation = this.wrapElement.getPrevious('.relation');
275
+ relation.getPrevious('.empty').addClass('hide');
276
+ if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
277
+ relation.getNext('.add_field').addClass('hide');
303
278
  }
304
- });
305
- }
306
- var windowHight = document.body.clientHeight;
307
- window.onresize = function(e){
308
- windowHight = document.body.clientHeight;
309
- };
310
- var scrollContent = function(){
311
- var innerForm = quickEdit.holder.getElement('form');
312
- if ( ! innerForm) { return; }
313
- var scroll = document.body.scrollTop-70;
314
- if (scroll < 10) {
315
- scroll = 10;
279
+ relation.adopt(
280
+ new Element('li').adopt(
281
+ new Element('a.quick_edit', {text: json.to_bhf_s || '', href: json.edit_path})
282
+ )
283
+ );
284
+ },
285
+ successAndChange: function(json){
286
+ this.wrapElement.set('text', json.to_bhf_s || '');
287
+ },
288
+ successAndNext: function(json){
289
+ var a = this.wrapElement;
290
+ var li = a.getParent('li');
291
+ if ( ! li) {
292
+ this.close();
293
+ return;
294
+ }
295
+ var holder = li.getNext('li');
296
+
297
+ if ( ! holder) {
298
+ holder = li.getParent('ul');
299
+ }
300
+ quickEdit.startEdit(holder.getElement('a'));
316
301
  }
317
- if (scroll + innerForm.getSize().y > windowHight) { return; }
318
- quickEdit.holder.setStyle('padding-top', scroll);
319
- };
320
- window.onscroll = scrollContent;
321
-
322
- var fm = $('flash_massages');
323
- if (fm) {
324
- fm.removeClass.delay(4000, fm, 'show');
302
+ });
303
+ }
304
+ var windowHight = document.body.clientHeight;
305
+ window.onresize = function(e){
306
+ windowHight = document.body.clientHeight;
307
+ };
308
+ var scrollContent = function(){
309
+ var innerForm = quickEdit.holder.getElement('form');
310
+ if ( ! innerForm) { return; }
311
+ var scroll = document.body.scrollTop-70;
312
+ if (scroll < 10) {
313
+ scroll = 10;
325
314
  }
326
-
327
- new BrowserUpdate({vs:{i:8,f:7,o:10.01,s:4,n:9}});
328
- });
329
- };
315
+ if (scroll + innerForm.getSize().y > windowHight) { return; }
316
+ quickEdit.holder.setStyle('padding-top', scroll);
317
+ };
318
+ window.onscroll = scrollContent;
330
319
 
331
- pageSetup();
332
- if (document.addEventListener) {
333
- document.addEventListener('page:fetch', function(){
334
- ajaxNote.loading();
335
- });
336
-
337
- document.addEventListener('page:load', function(){
338
- pageSetup();
339
- rails.applyEvents();
340
- ajaxNote.success();
341
- });
342
- }
320
+ var fm = $('flash_massages');
321
+ if (fm) {
322
+ fm.removeClass.delay(4000, fm, 'show');
323
+ }
324
+
325
+ new BrowserUpdate({vs:{i:8,f:7,o:10.01,s:4,n:9}});
326
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.12
4
+ version: 0.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2013-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails