dejanstojanovic / Facebook-Album-Browser

jQuery plugin for browsing public albums of a Facebook account
http://dejanstojanovic.github.io/Facebook-Album-Browser/
MIT License
74 stars 42 forks source link

How to close the selected picture? #51

Open ai2010 opened 7 years ago

ai2010 commented 7 years ago

Hello,

I'm using the following code to select a pciture from an album:

$(document).ready(function () {
                            $(".fb-album-container").FacebookAlbumBrowser({
                                account: "me",
                                accessToken:$localStorage.accessTokenFacebook,
                                showImageText: false,
                                likeButton:false,
                                shareButton: false,
                                //photosCheckbox:false,
                                showAccountInfo: false,
                                lightbox:true,
                                showComments: false,
                                photosPageSize: 0,
                                thumbnailSize: 100,
                                photoSelected: function(photo) {
                alert('here'+JSON.stringify(photo)+'--'+$scope.profilePhotos.length)
                                    var imgurl = photo.url;
                                    $scope.profilePhotos[imgindx].photo = imgurl;
                                    $localStorage.profilePhotos = $scope.profilePhotos;

                                    toDataUrl(imgurl,1000,1000, function(base64Img){
                                        alert('imagetoparse')

                                        var name = "photo.jpg";
                                        var parseFile = new Parse.File(name, {base64:base64Img});
                                        var Photo = new Parse.Object("Photos");
                                        Photo.set("user", $localStorage.username);
                                        Photo.set("type", $localStorage.profilePhotos[imgindx].type);
                                        Photo.set("photos", parseFile);
                                        $localStorage.imgcount = ($localStorage.imgcount + 1)
                                        alert($localStorage.profilePhotos[imgindx].type+'--'+$localStorage.imgcount)
                                        Photo.save(
                                            {
                                            success: function(objUser) {              
                                                alert("OK");

                                              },
                                              error: function(error) {
                                                alert("error"+error);
                                              }

                                            }
                                        ).then(function() {
                                            alert('statego')
                                            $state.go("profile_edit")
                                            return
                                        })
                                    })  
                                }
                            })
                        })

the problem is that the selected picture keeps staying on my screen instead of closing down (both the album browser and the picture and return on my screen. Any idea? Thanks in advance.

dejanstojanovic commented 7 years ago

Hi,

I haven't done any coding on this script for looooong time, so as a quick fix (as far as I remember), I think you can simulate click on the overlay to cause image to disappear from the screen. Let me know if this worked for you

dejanstojanovic commented 7 years ago

Hi @ai2010 did you try my suggestion? Does it works? Let me know so I can close this issue or keep it open