Bläddra i källkod

Adds a method to message handle that can render more than 2 buttons.

master
hristoterezov 11 år sedan
förälder
incheckning
3ff161321b
1 ändrade filer med 22 tillägg och 0 borttagningar
  1. 22
    0
      message_handler.js

+ 22
- 0
message_handler.js Visa fil

39
         });
39
         });
40
     };
40
     };
41
 
41
 
42
+    /**
43
+     * Shows a message to the user with two buttons: first is given as a parameter and the second is Cancel.
44
+     *
45
+     * @param titleString the title of the message
46
+     * @param msgString the text of the message
47
+     * @param persistent boolean value which determines whether the message is persistent or not
48
+     * @param buttons object with the buttons. The keys must be the name of the button and value is the value
49
+     * that will be passed to submitFunction
50
+     * @param submitFunction function to be called on submit
51
+     * @param loadedFunction function to be called after the prompt is fully loaded
52
+     */
53
+    my.openDialog = function(titleString, msgString, persistent, buttons, submitFunction, loadedFunction) {
54
+        $.prompt(msgString, {
55
+            title: titleString,
56
+            persistent: false,
57
+            buttons: buttons,
58
+            defaultButton: 1,
59
+            loaded: loadedFunction,
60
+            submit: submitFunction
61
+        });
62
+    };
63
+
42
     /**
64
     /**
43
      * Shows a dialog with different states to the user.
65
      * Shows a dialog with different states to the user.
44
      *
66
      *

Laddar…
Avbryt
Spara