fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

On crop not firing if cropper loaded in a bootstrap model #873

Closed DjustinK closed 7 years ago

DjustinK commented 7 years ago
var $image = $('#image');
$('#modal').on('shown.bs.modal', function () {
    $image.on({
        ready: function (e) {
            console.log(e.type);
        },
        cropstart: function (e) {
            console.log(e.type, e.action);
        },
        cropmove: function (e) {
            console.log(e.type, e.action);
        },
        cropend: function (e) {
            console.log(e.type, e.action);
        },
        crop: function (e) {
            console.log(e.type, e.x, e.y, e.width, e.height, e.rotate, e.scaleX, e.scaleY);
        },
        zoom: function (e) {
            console.log(e.type, e.ratio);
        }
    }).cropper({
        autoCropArea: 0.5
    });

}).on('hidden.bs.modal', function () {
    $image.cropper('destroy');
});

On crop not firing if cropper loaded in a bootstrap model, am i missing something? Its not only the on crop, the other bindings won't work either.

DjustinK commented 7 years ago

Got it working, may close the issue.

chrisloughnane commented 7 years ago

Hi, could you post your solution?

DjustinK commented 7 years ago

@chrisloughnane Its not a fix, i noticed that the project im working on used a very old version (0.7.6), its working with the latest version so this issue can be closed.