Author: pyaschenko
Date: 2010-05-04 11:10:11 -0400 (Tue, 04 May 2010)
New Revision: 16885
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
Log:
setQueueOptions was updated
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-04
14:39:11 UTC (rev 16884)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-04
15:10:11 UTC (rev 16885)
@@ -245,6 +245,8 @@
return {
+ DEFAULT_QUEUE_ID: DEFAULT_QUEUE_ID,
+
/**
* Get current queue size
* @function
@@ -340,21 +342,23 @@
* @function
* @name RichFaces.queue.setQueueOptions
*
- * @param {string} [id] - Queue id for storing options
+ * @param {string||object} [id] - Queue id for storing options or hash with options
for multiple options set
* @param {object} options - Queue options object
* */
setQueueOptions: function (id, options) {
- var queueId = DEFAULT_QUEUE_ID;
- if (typeof id == "string") {
- queueId = id;
- } else {
- options = id;
+ var tid = typeof id;
+ if (tid == "string") {
+ // add named queue options
+ if (defaultQueueOptions[id]) {
+ throw "Queue already registered";
+ } else {
+ defaultQueueOptions[id] = options;
+ }
+ } else if (tid == "object"){
+ // first parameter is hash with queue names and options
+ $.extend(defaultQueueOptions, id);
}
- if (defaultQueueOptions[queueId]) {
- throw "Queue already registered";
- } else {
- defaultQueueOptions[queueId] = options;
- }
+ return richfaces.queue;
}
}
}());
Show replies by date