Commits

Luke Plant committed 4d20f97

Stop tooltips from getting in the way.

Comments (0)

Files changed (1)

semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

 
 PresentationControls.prototype.build_optsbox = function() {
     this.optsbox.empty();
+    // Remove any tooltips
+    jQuery(".orbitaltooltip-simplebox").unbind().remove();
+
     var self = this;
     jQuery.each(this.available_styles, function(i, item) {
 	var val = flattenPresStyle(item);
 	    $(this).attr('id', 'id_optsbox_label_' + i);
 	    $(this).orbitaltooltip({
 		orbitalPosition: 270,
+		// Small spacing means we can move onto the tooltip
+		// in order to scroll it if the help text has
+		// produced scroll bars.
 		spacing:         5,
 		tooltipClass: 	 'orbitaltooltip-simplebox',
 		html:            help
 	    });
 	});
     });
+    // Stop the tooltips from getting in the way
+    // - dismiss with a click.
+    jQuery(".orbitaltooltip-simplebox").click(function(event) {
+						  jQuery(this).hide();
+					      });
 };
 
 PresentationControls.prototype.unbind_optsbox = function() {