How to use Y.Notify.Message?

I have a problem with http://yuilibrary.com/gallery/show/notify

Unfortunately, I'm using an older version of YUI (3.4.0), so itโ€™s even harder to look for solutions. I can't change it, so I have to stick with it :(

I read the documentation page a couple of times, but I still can't figure out how to use the flag . He says this is part of the Y.Notify.Message configuration, but how do I access it? There is no example on the site except a very simple way to use the Y.Notify constructor.

I tried something like this:

notification.add({ message : 'Some message', flag : 'some_flag', timeout : 1000, }); 

Unfortunately, he does nothing ...

Any help would be appreciated because I am more and more inclined towards some kind of third-party library ... However, I would prefer to use something that is part of the structure used.

The funniest part - I checked the source code on github: https://github.com/yui/yui3-gallery/blob/master/src/gallery-notify/js/notify.js

... and I do not see the flag there :(

However, I found it here: https://github.com/yui/yui3-gallery/blob/master/src/gallery-notify/js/notify.js~

What is the current version? Is anyone

I also checked the github repository for https://github.com/apipkin/xarno/blob/master/src/gallery-xarno-notify/js/notify.js , which should be the latest version of the code, and also does not have a flag .

Thank you, million!

+4
source share
1 answer

This is mistake. You must contact the author.

The workaround for adding a skinning class should be to first create a message as a widget, add your own class, and pass it to Y.Notify:

 var message = new Y.Notify.Message({ message: 'Some message', timeout: 1000 }); message.get('boundingBox').addClass('my-skin-class'); notification.add(message); 

Another option is to add it as an object to the notification widget, and then retrieve it using item(index) :

 notification.add({ message: 'Some message', timeout: 1000 }); notification.item(notification.size() - 1).get('boundingBox').addClass('my-skin-class'); 
+2
source

Source: https://habr.com/ru/post/1487020/


All Articles