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

Include source message view in the message click event #9

Open
sindresorhus opened this issue Sep 16, 2011 · 3 comments
Open

Include source message view in the message click event #9

sindresorhus opened this issue Sep 16, 2011 · 3 comments

Comments

@sindresorhus
Copy link
Contributor

Can you include the source view of the message in the event object of the message click event?

On iPad OptionDialog needs a source view to know where to place the OptionDialog popover. I'm showing a OptionDialog when a message is clicked. I tried using event.source, but it seems to be the source view of the message table.

@pec1985
Copy link
Owner

pec1985 commented Sep 16, 2011

Not really sure what you mean... could you provide some code? Also, this is right now an iPhone only module, I have not tested it on the iPad, and I'm afraid to see how it would look like :)

On a later version I will include support for iPad.

@sindresorhus
Copy link
Contributor Author

Example code:

var messageActionDialog = Ti.UI.createOptionDialog({
    options: ['Copy', 'Cancel'],
    cancel: 1
});

textArea.addEventListener('messageClicked', function(e) {
    if ( e.text ) {
        messageActionDialog.show({
            view: e.source
        });
    }
});

The event object I get when clicking a message now is:

{

    source = "[object TiPedroSMSView]";

    text = "test\n";

    type = messageClicked;

    where = message;

}

What I need is a reference to the message view, so I can put it into the view property of the .show() method of the OptionDialog. OptionDialog needs this property to know where to place the popover on iPad.

The source property should point to the message view ([object TiPedroSMSMessageView]?) and not the whole view.

The event object should also be documented.


Also, this is right now an iPhone only module, I have not tested it on the iPad, and I'm afraid to see how it would look like :)

In portrait on iPad it works perfectly, but in landscape the textArea toolbar disappears.

@pec1985
Copy link
Owner

pec1985 commented Sep 18, 2011

Not sure if this is possible, will look into it next weekend.

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

No branches or pull requests

2 participants