# HG changeset patch # User cavaliet # Date 1334843254 -7200 # Node ID a5607fa1ef0b3be383194e8093ebb7fe10d9e6be # Parent faae5df935de2d1a835f64fbc90d36934f7f0e05 Enhance SlideShare widget for it to point the a specified div (like annotationListWidget). diff -r faae5df935de -r a5607fa1ef0b src/js/widgets/slideShareWidget.js --- a/src/js/widgets/slideShareWidget.js Wed Apr 18 13:37:00 2012 +0200 +++ b/src/js/widgets/slideShareWidget.js Thu Apr 19 15:47:34 2012 +0200 @@ -9,8 +9,13 @@ IriSP.SlideShareWidget.prototype.draw = function() { var self = this; + // If the div supposed to host the slides does not exist, we cancel + if(this.selector.length==0){ + if(console){ if(console.log){ console.log("No div for slideshare widget, this widget is canceled. id = " + this._id); } } + return; + } var templ = Mustache.to_html(IriSP.slideShareWidget_template); - this.selector.append(templ); + this.selector.html(templ); // Synchro management this._disableUpdate = false; @@ -36,7 +41,8 @@ var annotations = this._serializer._data.annotations; var view_type = this._serializer.getSlideShareType(); if(typeof(view_type) === "undefined") { - return; + if(console){ if(console.log){ console.log("No annotation-type for slideshare widget, this widget is canceled."); } } + return; } var i = 0; this.segments_slides = []; diff -r faae5df935de -r a5607fa1ef0b src/templates/slideShareWidget.html --- a/src/templates/slideShareWidget.html Wed Apr 18 13:37:00 2012 +0200 +++ b/src/templates/slideShareWidget.html Thu Apr 19 15:47:34 2012 +0200 @@ -1,2 +1,2 @@ {{! template for the slideShare widget of the other }} -