Commit 2803cd39 authored by Sven Franck's avatar Sven Franck

JQM-extensions: fixed refreshing carousel widget

parent cb35fb6b
...@@ -52,9 +52,9 @@ define([ ...@@ -52,9 +52,9 @@ define([
items = el.children(), items = el.children(),
fragment = document.createDocumentFragment(), fragment = document.createDocumentFragment(),
classes = "ui-carousel", classes = "ui-carousel",
barrel,
label, label,
radio, radio,
barrel,
item, item,
i, i,
transition, transition,
...@@ -109,7 +109,7 @@ define([ ...@@ -109,7 +109,7 @@ define([
if (o.bullets) { if (o.bullets) {
classes += " ui-carousel-bullets"; classes += " ui-carousel-bullets";
barrel = $("<div class='ui-carousel-controls ui-carousel-controls-" + o.bulletPos +"' />"); barrel = $("<div id='ui-carousel-barrel-" + this.uuid + "' class='ui-carousel-controls ui-carousel-controls-" + o.bulletsPos +"' />")
while ( fragment.firstChild ) { while ( fragment.firstChild ) {
// browser hangs up if calling this inside append() // browser hangs up if calling this inside append()
...@@ -118,8 +118,13 @@ define([ ...@@ -118,8 +118,13 @@ define([
fragment.firstChild fragment.firstChild
); );
} }
// remove existing barrel
if (create === undefined) {
console.log($("#ui-carousel-barrel-" + this.uuid ));
$("#ui-carousel-barrel-" + this.uuid ).remove();
}
// this always needs to go before the slider // this always needs to go before the slider
el[o.bulletPos === "top" ? "before" : "after"](barrel); el[o.bulletsPos === "top" ? "before" : "after"](barrel);
this._on(barrel.find("input"), { change: "_onChange"}); this._on(barrel.find("input"), { change: "_onChange"});
} }
......
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