Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Need to capture cancel event in nwsaveas #4501

@ed4becky

Description

@ed4becky

I have followed the instructions for a SaveAs dialog and it works like a charms

EXCEPT...

If the user cancels, I have some code that needs to execute. However the cancel event doesn't trigger the change event.

So How can I respond to the cancel of the file saveas dialog?

function openSaveAs(prompt, cb) {
var saver = $('#saveAsFileDialog');
saver.attr('nwsaveas', prompt);
saver.unbind('change');
saver.val("");
saver.bind('change', function (evt) {
if(cb) cb($(this).val());
});
saver.trigger('click');
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions