Skip to content

Commit 1604994

Browse files
committed
Simplifies the application logic
1 parent 08dbdcd commit 1604994

File tree

4 files changed

+4
-36
lines changed

4 files changed

+4
-36
lines changed

app/helpers/gtt_map_helper.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ def map_tag(map: nil, layers: map&.layers,
3434
content_tag(:div, "", data: data, id: uid, class: 'ol-map'),
3535
javascript_tag("
3636
$(document).ready(function(){
37-
$('##{uid}').each(function(idx) {
38-
App.init({
39-
target: this
40-
});
37+
App.init({
38+
target: $('##{uid}')[0]
4139
});
4240
});
4341
")

assets/javascripts/app.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

assets/javascripts/app.map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @param {[type]} publ [description]
55
* @return {[type]} [description]
66
*/
7-
App.map = (function ($, publ) {
7+
var App = (function ($, publ) {
88

99
var map, vector, bounds, contents, toolbar, geolocation = null;
1010
var features = [];
@@ -589,4 +589,4 @@ App.map = (function ($, publ) {
589589
*/
590590
return publ;
591591

592-
})(jQuery, App.map || {});
592+
})(jQuery, App || {});

lib/redmine_gtt/hooks/view_layouts_base_html_head_hook.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def view_layouts_base_html_head(context={})
1414

1515
tags << javascript_include_tag('ol.js', :plugin => 'redmine_gtt')
1616
tags << javascript_include_tag('ol3-ext.min.js', :plugin => 'redmine_gtt')
17-
tags << javascript_include_tag('app.js', :plugin => 'redmine_gtt')
1817
tags << javascript_include_tag('app.map.js', :plugin => 'redmine_gtt')
1918
return tags.join("\n")
2019
end

0 commit comments

Comments
 (0)