]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix setting ocdialog options after initialization.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 9 Sep 2013 22:21:42 +0000 (00:21 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 9 Sep 2013 22:21:42 +0000 (00:21 +0200)
core/js/jquery.ocdialog.js

index bafbd0e0e9f9dbe69f9f47e117a6b2aeef9c506f..ee492d15f5852bc010935c793f1e0038b179d195 100644 (file)
                        var self = this;
                        switch(key) {
                                case 'title':
-                                       var $title = $('<h3 class="oc-dialog-title">' + this.options.title
-                                               + '</h3>'); //<hr class="oc-dialog-separator" />');
                                        if(this.$title) {
-                                               this.$title.replaceWith($title);
+                                               this.$title.text(value);
                                        } else {
+                                               var $title = $('<h3 class="oc-dialog-title">'
+                                                       + value
+                                                       + '</h3>');
                                                this.$title = $title.prependTo(this.$dialog);
                                        }
                                        this._setSizes();
                                        break;
                                case 'buttons':
-                                       var $buttonrow = $('<div class="oc-dialog-buttonrow" />');
+                                       console.log('buttons', value);
                                        if(this.$buttonrow) {
-                                               this.$buttonrow.replaceWith($buttonrow);
+                                               this.$buttonrow.empty();
                                        } else {
+                                               var $buttonrow = $('<div class="oc-dialog-buttonrow" />');
                                                this.$buttonrow = $buttonrow.appendTo(this.$dialog);
                                        }
                                        $.each(value, function(idx, val) {
                                                $closeButton.on('click', function() {
                                                        self.close();
                                                });
+                                       } else {
+                                               this.$dialog.find('.oc-dialog-close').remove();
                                        }
                                        break;
                                case 'width':