Adds disabled class toggle for JS toggle action
authorMatthias Schmidt <gravatronics@live.com>
Tue, 27 Dec 2011 19:29:17 +0000 (20:29 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 27 Dec 2011 19:29:17 +0000 (20:29 +0100)
If a database object is disabled, its row gets the CSS class `disabled`. If it is enabled, the `disabled` class is removed.

wcfsetup/install/files/js/WCF.js

index 127fd1d58ea5279197cae6a83f54b2d60cb1f2cb..b8c77539dc10c6b9c38528766e8fe5cc1159e731 100644 (file)
@@ -1350,6 +1350,7 @@ WCF.Action.Toggle.prototype = {
                                                return this.src.replace(/enabled1\.svg$/, 'disabled1.svg');
                                        }
                                });
+                               
                                // toogle icon title
                                $toggleButton.attr('title', function() {
                                        if (this.src.match(/enabled1\.svg$/)) {
@@ -1359,6 +1360,9 @@ WCF.Action.Toggle.prototype = {
                                                return $(this).data('enableMessage');
                                        }
                                });
+                               
+                               // toggle css class
+                               $(container).toggleClass('disabled');
                        }
                });
        }