Domanda

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

Unfortunately I'm using the older version of YUI (3.4.0) so it's even harder to search for the solutions. I can't change it so I have to stick to it :(

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

I was trying something like that:

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

Unfortunately it does nothing ...

Any help will be appreciated, because I'm leaning to some 3rd-party library more and more... Still I would rather use something that is part of the framework I use.

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

...and I don't see any flag there :(

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

What is the current version? 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 most recent version of the code and it also has no flag.

Thanks a million!

È stato utile?

Soluzione

It's a bug. You should contact the author.

A workaround to add a class for skinning would be to create the message as a widget first, add your class and then 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 would be 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');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top