Skip to content

Commit

Permalink
Fix page switch by GA
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMayer committed Feb 15, 2015
1 parent c025781 commit 1a541d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/lib/templateengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function TemplateEngine( undefined ) {
{
var
element = document.getElementById( id ),
type = element.dataset.type,
type = element.dataset.type || 'page', // only pages have no datatype set
updateFn = thisTemplateEngine.design.creators[ type ].update;
if( updateFn )
{
Expand Down
22 changes: 9 additions & 13 deletions src/structure/pure/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ design.basicdesign.addCreator('page', {
var address = {};
if ($p.attr('ga')) {
src = $p.attr('ga');
templateEngine.addAddress($p.attr('ga'));
address[ '_' + $p.attr('ga') ] = [ 'DPT:1.001', 0 ];
templateEngine.addAddress( $p.attr('ga'), path + '_' );
address[ $p.attr('ga') ] = [ 'DPT:1.001', 0 ];
}

var name = $p.attr('name');
Expand Down Expand Up @@ -94,7 +94,6 @@ design.basicdesign.addCreator('page', {
shownavbar : shownavbar
});
var $container = $( '<div class="clearfix" style="height:100%;position:relative;" />');
for( var addr in address ) $container.bind( addr, this.update );
var container=$container;

container.append( '<h1>' + name + '</h1>' );
Expand Down Expand Up @@ -122,19 +121,16 @@ design.basicdesign.addCreator('page', {
}}, floorplan.translateMouseEvent );
$(window).bind( 'resize', function(){ floorplan.resize($('.page').width(), $('.page').height(), true);} );
if ($p.attr('azimut')) {
templateEngine.addAddress($p.attr('azimut'));
address[ '_' + $p.attr('azimut') ] = [ 'DPT:9.001', 0, 'azimut' ];
container.bind( '_' + $p.attr('azimut'), this.update );
templateEngine.addAddress( $p.attr('azimut'), path + '_' );
address[ $p.attr('azimut') ] = [ 'DPT:9.001', 0, 'azimut' ];
}
if ($p.attr('elevation')) {
templateEngine.addAddress($p.attr('elevation'));
address[ '_' + $p.attr('elevation') ] = [ 'DPT:9.001', 0, 'elevation' ];
container.bind( '_' + $p.attr('elevation'), this.update );
templateEngine.addAddress( $p.attr('elevation'), path + '_' );
address[ $p.attr('elevation') ] = [ 'DPT:9.001', 0, 'elevation' ];
};
if ($p.attr('floor')) {
templateEngine.addAddress($p.attr('floor'));
address[ '_' + $p.attr('floor') ] = [ 'DPT:5.004', 0, 'floor' ];
container.bind( '_' + $p.attr('floor'), this.update );
templateEngine.addAddress( $p.attr('floor'), path + '_' );
address[ $p.attr('floor') ] = [ 'DPT:5.004', 0, 'floor' ];
};

$( childs ).each( function(i,a){
Expand All @@ -161,7 +157,7 @@ design.basicdesign.addCreator('page', {
$('#pages').prepend( subpage );
return ret_val;
},
update: function( ga, data) {
update: function( ga, data ) {
var
element = $(this),
widgetData = templateEngine.widgetDataGetByElement( element );
Expand Down

0 comments on commit 1a541d3

Please sign in to comment.