mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-08 13:45:28 -05:00
Follow js event namespacing conventions and only possibly init brush once (#2202)
* underscore the shiny_image_interaction namespace * namespace dragstart * use `one` instead of `on` * compile
This commit is contained in:
@@ -120,8 +120,8 @@ $.extend(imageOutputBinding, {
|
||||
// even if it's a data URL. If we try to initialize this stuff
|
||||
// immediately, it can cause problems because we use we need the raw image
|
||||
// height and width
|
||||
$img.off("load.shiny-image-interaction");
|
||||
$img.on("load.shiny-image-interaction", function() {
|
||||
$img.off("load.shiny_image_interaction");
|
||||
$img.one("load.shiny_image_interaction", function() {
|
||||
|
||||
imageutils.initCoordmap($el, opts.coordmap);
|
||||
|
||||
@@ -176,7 +176,7 @@ $.extend(imageOutputBinding, {
|
||||
// Make image non-draggable (Chrome, Safari)
|
||||
$img.css('-webkit-user-drag', 'none');
|
||||
// Firefox, IE<=10
|
||||
$img.on('dragstart', function() { return false; });
|
||||
$img.on('dragstart.image_output', function() { return false; });
|
||||
|
||||
// Disable selection of image and text when dragging in IE<=10
|
||||
$el.on('selectstart.image_output', function() { return false; });
|
||||
|
||||
Reference in New Issue
Block a user