chieforz / popups Goto Github PK
View Code? Open in Web Editor NEWA simple way to display beautiful popupS.
Home Page: http://chieforz.github.io/popupS/
A simple way to display beautiful popupS.
Home Page: http://chieforz.github.io/popupS/
I tried to use your model however after installin the npm package and try your sample code i keep getting this error.
var el = document.createElement("fakeelement");
^
ReferenceError: document is not defined
Originally posted by @GrumpyCrouton in #6 (comment)
I am experiencing this as well.
I'm using popupS in an Electron-based SPA app, and hitting Enter on a prompt does a full reload, taking my users away from whatever they were doing.
Is there a way to disable this behavior?
Hello, i hope you are good.
But, i don't find where i could display the content of the popups after the request of ajax (to get the content)
This my code :
popupS.window({
mode: 'modal-ajax',
title: 'Nouveau salon',
content : '',
onOpen: function(e){
display_content_of_ajax(e)
}, // gets called when popup is opened
onSubmit: function(val){
},
ajax : {
url : '/salon_nouveau_template',
post : true,
},
onClose: function(){} // gets called when popup is closed
});
});
i wanted to show an alert but i faced this error .
F:\DEV\nodeJS - expressJS\instagram\test2>node app.js
F:\DEV\nodeJS - expressJS\instagram\test2\node_modules\popups\dist\popupS.js:29
appendLocation: (document.body || document.documentElement),
^
ReferenceError:
document is not defined
at F:\DEV\nodeJS - expressJS\instagram\test2\node_modules\popups\dist\popupS.js:29:26
at isOpen (F:\DEV\nodeJS - expressJS\instagram\test2\node_modules\popups\dist\popupS.js:6:26)
at Object. (F:\DEV\nodeJS - expressJS\instagram\test2\node_modules\popups\dist\popupS.js:11:2)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
what shoul i do ?
There should be an event for onCancel so that you don't have to use onClose. When you click off of the popop box, it throws an onClose event, meaning that if you have 2 different options in a popup, like this:
popupS.confirm({
content: '<b>Do you like what you see?</b>',
labelOk: 'Yes',
labelCancel: 'No',
onSubmit: function() {
console.log(':)');
},
onClose: function() {
console.log(':(');
}
});
clicking off of the popup will make console.log(':(');
run, which may not be proper behavior for any app.
For example, in the app I am working on, I have several nested popups.
popupS.confirm({
content: '<span style="color:black;">We need some more information.<br>Would you like to input a UPC or a Model?</span>',
labelOk: 'UPC',
labelCancel: 'Model',
onSubmit: function() {
popupS.prompt({
content: 'Please enter a UPC',
onSubmit: function(val) {
popupS.alert({
content: 'Hi, ' + val + '!'
});
},
onClose: function() {
insertModel();
}
});
},
onClose: function() {
popupS.prompt({
content: 'Please enter a Model',
onSubmit: function(val) {
popupS.alert({
content: 'Hi, ' + val + '!'
});
},
onClose: function() {
insertModel();
}
});
}
});
When the user gets to this page and a popup happens, the user has 2 options "UPC" and "Model". Each respective button will launch a new popup with an input box. The problem is, if the user accidentally clicks off of the popup it will default to "Please enter a Model". Easy enough, just put a cancel button which restarts the the popup right? That's what I've done. As you can se in onClose in the nested popups, I recall the function that started the popup anyways. This works okay for a cancel button, but there is a deeper problem. Say the user selects "UPC" in the first dialogue, then they accidentally click off of the pop. For some reason, this will switch the popup to "Please enter a Model" (Which is unexpected). It also seems that occasianlly if this happens, it will lock up the buttons on the "Please enter a Model" page, where neither button works, and I can't force close the app with alt+F4, I have to close it by right clicking the executable in the taskbar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.