Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to close the selected picture? #51

Open
ai2010 opened this issue Sep 28, 2016 · 2 comments
Open

How to close the selected picture? #51

ai2010 opened this issue Sep 28, 2016 · 2 comments

Comments

@ai2010
Copy link

ai2010 commented Sep 28, 2016

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
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants