fabiobiondi / angular-fullscreen

AngularJS HTML5 Fullscreen
214 stars 107 forks source link

Disable Fullscreen on Double Click #58

Open Vikram0811 opened 7 years ago

Vikram0811 commented 7 years ago

HI,

I need to disable fullscreen on double click. We are using below code to display image in fullscreen when user clicks on fullscreen icon.

$scope.goFullScreen = function (id) {
                if (Fullscreen.isEnabled() === null || angular.equals(Fullscreen.isEnabled(), undefined)) {
                    Fullscreen.enable($("#myId" + id)[0]);
                } else {
                    Fullscreen.cancel();
                    $("#myId" + id).removeClass("fullscreen_IE");
                }
            };

Now we need to disable fullscreen when user double click on any image, but the below code always executes.

if (navigator.userAgent.indexOf("Firefox") != -1)
                            {

                                $element.on('dblclick', function (ev) {
                                    Fullscreen.enable($element[0]); //comment this line because of disable double click fullscreen
                                });

                            }else{

                                $element.on('dblclick', function (ev) {
                                    Fullscreen.enable($element[0]);

                                });

                            }

How do I prevent this by either doing changes in my custom function or making a new one. P.S. : I do not want to make any changes in angular-fullscreen.js library.

Thanks.