Comments (10)
From code, no. You can click to close, plus it automatically closes after set time. Can you provide a use case for this?
from alertify.js.
This is related to my other issue. My use case is this:
- User clicks a button that triggers a process that can take a number of seconds.
- The system shows a notification that the operation is in progress
- When the operation is completed the first notification is closed and another notification is displayed to indicate the outcome
There's two things I'd like to do here that I can't using the current API:
- Use Spin.js to display a progress indicator, but this requires a DOM element to attach itself to and I can't get this from the Alertify API
- Close the first notification when the operation completes
from alertify.js.
I see your point. I'm thinking I may return the log message instead of the alertify object... This would take away chaining on log messages, but would return the newly created log message.
I'll have to consider a few options, see what makes the most sense.
from alertify.js.
My suggestion would be to support chaining through the Alertify
global, which internally uses an OO Alertify
prototype. Then for this scenario API users could use Aleritfy.create()
or new Alertify()
then have access to instance-specific operations. This Alertify prototyp coule expose the DOM element through a method or a property (ie. .element(), .el, .getElement() etc.) and have a .close() method.
function() {
Alertify = function() {...}
Alertify.prototype = {
el: null,
alert: function() {
...
return global;
},
close: function() {...}
}
return global = {
alert: function() {
return new Alertify().alert();
},
...
create: function() {
return new Alertify();
}
}
}
Alertify.alert('Hello world')
var obj = Alertify.create();
obj.alert('Hello world')
new Spinner().spin(obj.el)
obj.close();
from alertify.js.
I'm facing the same issue. I have to show a permanent alert, something like alertify.log( "Make some action to progress!", "custom",0 )
, until a user will take some actions. Then my code has to close it.
from alertify.js.
@SimonWade this is a good approach. I was thinking of separating the log message and the dialog message into separate modules. I would keep the dialog module as a singleton and restructure the log module as a factory.
The idea would be to offer a custom build option for alertify to only include the parts needed.
from alertify.js.
I'm not against code separation, but the build process should be optional IMO. One of the things I like about Alertify was that I could bring it in using bower and it worked straight away. So I think that adding the .create() method (or whatever it's called) and, if you do decide to modularise, then include a full build including both dialogs and log messages in the repo.
from alertify.js.
The custom build would be optional - similar to Modernizr.
Bower would still pull in the full core library (no extension). The custom build option would simply be available for extensions that shouldn't be in the core library, but could be useful to some.
from alertify.js.
Okay, sounds great!
Cheers,
Simon
On 17 January 2013 02:30, Fabien Doiron [email protected] wrote:
The custom build would be optional - similar to Modernizrhttp://modernizr.com/download/
.Bower would still pull in the full core library (no extension). The custom
build option would simply be available for extensions that shouldn't be in
the core library, but could be useful to some.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/89#issuecomment-12323364.
from alertify.js.
This issue is resolved in 0.4.0rc1
. You can now do:
var log = Alertify.log.info("Notification Message", 0);
// close
log.close();
// after closing, you can recreate and reshow
log.create();
log.show();
// you can also get the log element
// returns DOM element
log.el
You can try it out on the demo site
from alertify.js.
Related Issues (20)
- Can you add timeout function for confirmation and alert too? HOT 1
- Button focus error.
- Change Button Colour Dynamically / Multiple Buttons HOT 1
- Add main file in package.json HOT 1
- Since alertify is no longer maintained, consider jAlert HOT 9
- Alertify confirms and submits a form automatically without clicking OK. HOT 1
- can i use alertify in react HOT 2
- Prevent Duplicates HOT 2
- Notifications in background
- Missing default bootstrap skin without theme
- Does it supports on IE9 and below HOT 1
- How to enable alert and prompt at same time
- not working with firefox HOT 3
- How can I add an checkbox to promt and catch result? HOT 1
- issue with alertify I want display outside the iframe onClicking button
- how can i change the date formatting by using jqury
- Confirm popup not wotking for mobile device
- a href tag
- prevent close on enter
- Alertify Confirm Automatically Refresh Page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertify.js.