mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04: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:
@@ -2680,8 +2680,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
// 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);
|
||||
|
||||
@@ -2732,7 +2732,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
// Make image non-draggable (Chrome, Safari)
|
||||
$img.css('-webkit-user-drag', 'none');
|
||||
// Firefox, IE<=10
|
||||
$img.on('dragstart', function () {
|
||||
$img.on('dragstart.image_output', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
inst/www/shared/shiny.min.js
vendored
4
inst/www/shared/shiny.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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