UI kit notify pos issue

187 Views Asked by At
   <script>
            $(function(){

                var ws_scheme = window.location.protocol == "https:" ? "wss": "ws";
                var ws_path = ws_scheme + "://" + window.location.host + "/dashboard";
                console.log("Connecting to " + ws_path);
                var socket = new ReconnectingWebSocket(ws_path);
                socket.onmessage = function (message) {
                    // Decode the JSON
                    console.log("Got websocket message " + message.data);
                    var display = '<div class="uk-alert uk-alert-success">'+ message.data + "</div>";
                    console.log("Got websocket message " + display);
                    UIkit.notify({
                        message : display,
                        status  : 'info',
                        timeout : 0,
                        pos     : 'top-center'
                        });
                    }
            });
  </script>

For the following snippet of code, UI kit notify is displaying the notification in the bottom left corner of the screen. It doesn't change if I can the position to other possible values.

I must be doing something very silly. Any help is appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

Message inside uikit notify is string only, maybe using div inside spoils the rest, try to make fiddle out of that.

Also notify component has its own css, be sure to include it.