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

JQM-extensions: fixed refreshing carousel widget

parent cb35fb6b
......@@ -52,9 +52,9 @@ define([
items = el.children(),
fragment = document.createDocumentFragment(),
classes = "ui-carousel",
barrel,
label,
radio,
barrel,
item,
i,
transition,
......@@ -109,7 +109,7 @@ define([
if (o.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 ) {
// browser hangs up if calling this inside append()
......@@ -118,8 +118,13 @@ define([
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
el[o.bulletPos === "top" ? "before" : "after"](barrel);
el[o.bulletsPos === "top" ? "before" : "after"](barrel);
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