[Libreoffice-commits] online.git: loleaflet/src

Mihai Varga mihai.varga at collabora.com
Thu Aug 6 08:08:02 PDT 2015


 loleaflet/src/control/Control.Dialog.js |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 843dab3476c0407272dade24cd4012ce5c26c620
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Thu Aug 6 18:07:38 2015 +0300

    loleaflet: dialog control

diff --git a/loleaflet/src/control/Control.Dialog.js b/loleaflet/src/control/Control.Dialog.js
new file mode 100644
index 0000000..98a6b48
--- /dev/null
+++ b/loleaflet/src/control/Control.Dialog.js
@@ -0,0 +1,18 @@
+/*
+ * L.Control.Dialog used for displaying alerts
+ */
+
+L.Control.Dialog = L.Control.extend({
+	onAdd: function (map) {
+		map.on('error', this._onError, this);
+		return document.createElement('div');
+	},
+
+	_onError: function (e) {
+		vex.dialog.alert(e.msg);
+	}
+});
+
+L.control.dialog = function (options) {
+	return new L.Control.Dialog(options);
+};


More information about the Libreoffice-commits mailing list