Commit 1e680499 authored by Sven Franck's avatar Sven Franck

bugfix: renderjs storing DOM of removed pages fails enhancement

parent be2f30fc
<!DOCTYPE html>
<head>
<style type="text/css">
.menu_analysis { text-align: center;}
</style>
</head>
<body>
<div class="menu_analysis">
<div class="method_menu" data-role="controlgroup" data-type="horizontal">
<a class="t" data-inline="true" href="providers.html" data-role="button" data-i18n-target=".ui-btn-text" data-i18n="[title]gen.providers_info;gen.providers"></a>
<a class="t" data-inline="true" href="criteria.html" data-role="button" data-i18n-target=".ui-btn-text" data-i18n="[title]gen.monitoring_info;gen.monitoring"></a>
</div>
</div>
</script>
<script type="text/javascript" language="javascript">
//<![CDATA[
$(document).ready(function() {
var gadget = RenderJs.getSelfGadget();
// trigger enhancement
$(this).trigger("render_enhance", {gadget: gadget.dom});
});
//]]>
</script>
</body>
</html>
<html>
<head>
</head>
<body>
<div class="method_menu" data-role="controlgroup" datatype="horizontal">
<a href="providers.html" data-role="button" data-i18n="[title]gen.providers">bla</a>
<a href="criteria.html" data-role="button" data-i18n="[title]gen.monitoring">bla</a>
</div>
<script type="text/javascript" language="javascript">
//<![CDATA[
$('.method_menu').controlgroup({
create: function( event, ui ) {}
});
//]]>
</script>
</body>
</html>
This diff is collapsed.
<!DOCTYPE html>
<head>
<style type="text/css">
<style type="text/css" scoped>
/* header wrappers */
.ui-header { height: 41px;}
.headWrapLeft, .headWrapRight { height: inherit; margin-top: -4px; }
......@@ -21,7 +21,7 @@
</div>
</div>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
//<![CDATA[
var gadget = RenderJs.getSelfGadget(),
recursive_gadgets = gadget.dom.find("[data-gadget]").not(".main-interactor"),
......
......@@ -6,21 +6,11 @@
<body>
<div id="index_configure" data-gadget="../gadgets/configure.html"></div>
<div id="index_social" data-gadget="../gadgets/social.html"></div>
<div id="index_analysis" data-gadget="../gadgets/analysis.html"></div>
<div id="index_nav" data-gadget="../gadgets/navigation.html"></div>
<p class="mini t" data-i18n="gen.disclaimer"></p>
<!-- interactions -->
<div data-gadget="" class="main-interactor"
data-gadget-connection="[]">
<script type="text/javascript" language="javascript">
//<![CDATA[
$(document).ready(function() {
var gadget = RenderJs.getSelfGadget();
});
//]]>
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<head>
<style type="text/css">
<style type="text/css" scoped>
/* simple menu */
.simple_menu {list-style: none; display: inline-block; padding: 0 !important;}
.simple_menu li {float: right; padding: 0 0.5em;}
......@@ -23,13 +23,12 @@
</p>
</section>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var gadget = RenderJs.getSelfGadget();
// trigger enhancement
$(this).trigger("render_enhance", {gadget: gadget.dom});
$(this).trigger("render_enhance", {"gadget": gadget.dom, "time":"ready"});
});
//]]>
</script>
......
<!DOCTYPE html>
<head>
<style type="text/css">
<style type="text/css" scoped>
/* search_criteria */
#results_list .search_info {text-align: center;}
#results_list .search_criteria {font-weight: bold; }
......
......@@ -4,29 +4,11 @@
<body>
<div id="results_list" data-gadget="../gadgets/results.html"></div>
<div id="results_ad" data-gadget="../gadgets/ad.html"></div>
<div class="rwd">
<div class="ui-rwd-a">
<div id="results_social" data-gadget="../gadgets/social.html"></div>
</div>
<div class="ui-rwd-b">
<div id="results_analysis" data-gadget="../gadgets/analysis.html"></div>
</div>
</div>
<div id="results_nav" data-gadget="../gadgets/navigation.html"></div>
<p class="mini t" data-i18n="gen.disclaimer"></p>
<!-- interactions -->
<div data-gadget="" class="main-interactor"
data-gadget-connection="[]">
<script type="text/javascript" language="javascript">
//<![CDATA[
$(document).ready(function() {
var gadget = RenderJs.getSelfGadget();
});
//]]>
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<head>
<style type="text/css">
<style type="text/css" scoped>
.menu_social {text-align: center;}
.action_menu {display: inline-block;}
.follow_us {display: inline-block; margin: 0; padding: 0 .5em 0 0;}
......@@ -18,7 +18,7 @@
</div>
</div>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var gadget = RenderJs.getSelfGadget();
......
<!DOCTYPE html>
<head>
<style type="text/css">
<style type="text/css" scoped>
/* custom icons - languages */
.ui-icon-lang { background-image: url(../img/custom-lang-18.png); }
......@@ -69,7 +69,7 @@
</ul>
</div>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
//<![CDATA[
var gadget = RenderJs.getSelfGadget(),
i,
......
......@@ -88,12 +88,12 @@ define([], function () {
.removeClass('ui-btn-icon-left ui-btn-icon-right ui-btn-icon-top ui-btn-icon-bottom')
.attr('data-iconpos','notext')
.addClass('ui-btn-icon-notext');
/*
// reshuffle table
$('#configure tbody tr').each(function () {
var content = $(this).children('td, th').last().hide().find('.ui-btn');
content.addClass('relocate').appendTo($(this).children('td, th').first());
});
});*/
} else {
$(".scale-a, .scale-div .ui-btn").add( $(".scale-input").closest('.ui-btn') ).each(function() {
......@@ -102,11 +102,11 @@ define([], function () {
.removeAttr('data-iconpos')
.addClass('ui-btn-icon-'+($(this).jqmData('iconpos') || 'left'));
});
/*
// reshuffle table
$('#configure .relocate').each(function (i) {
$(this).appendTo($('#configure tbody tr').eq(i).find('td').show().last());
});
});*/
}
}
};
......@@ -176,14 +176,6 @@ define([], function () {
});
});
// because render_enhance does not work on external page gadgets...
//$(document).on('pageshow', 'div:jqmData(external-page="true")', function() {
// $(this)
// .filter(function() { return $(this).jqmData("pcm") !== true; })
// .jqmData("pcm", true)
// .trigger('pagecreate');
//});
// enhancing gadgets when everyone else is done
$(document).on('render_enhance', function(e, data) {
data.gadget.trigger("create");
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -149,6 +149,10 @@ var RenderJs = (function () {
gadget_js = new RenderJs.Gadget(gadget_id, gadget);
RenderJs.GadgetIndex.registerGadget(gadget_js);
}
// not a nice check, improve if you can
if (!gadget_js.dom.closest("body").length) {
gadget_js.dom = gadget;
}
if (gadget_js.isReady()) {
// avoid loading again gadget which was loaded before in same page
return ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment