Commits

Anonymous committed 2b5ba60

Javascript code fixes.

  • Participants
  • Parent commits 667df9f

Comments (0)

Files changed (6)

views/assignments/index.php

             $.ajax({
                 type: 'POST',
                 url: '<?php echo $this->createUrl('assignments/assign'); ?>',
-                data: 'name=' + t.val() + '&userId=' + t.attr('rel') + '&action=' + (t.attr('checked') == 'checked' ? 'revoke' : 'add') + '&timestamp=' + (new Date()).getTime(),
+                data: 'name=' + t.val() + '&userId=' + t.attr('rel') + '&action=' + (t.attr('checked') === 'checked' ? 'revoke' : 'add') + '&timestamp=' + (new Date()).getTime(),
                 beforeSend: function() {
                     t.parent().next().addClass('rbac-waiting rbac-waiting-left');
                 },

views/default/scaner.php

         beautifyCheckbox();
         $('input:checkbox').live('click', function() {
             var t = $(this);
-            if (t.attr('checked') == 'checked') {
+            if (t.attr('checked') === 'checked') {
                 return false;
             }
             var text = t.val();
                 var name = text.substr(2, text.length);
             }
             var description = t.parent().next().next().next().html();
-            if (description == '&nbsp;') {
+            if (description === '&nbsp;') {
                 description = '';
             }
             $.ajax({
                 }
             });
             return true;
-        })
-    })
+        });
+    });
 </script>

views/default/showAllowedAuthItems.php

             $.ajax({
                 type: 'POST',
                 url: '<?php echo $this->createUrl('items/setAllowedAuthItem'); ?>',
-                data: 'name=' + t.val() + '&action=' + (t.attr('checked') == 'checked' ? 'remove' : 'add'),
+                data: 'name=' + t.val() + '&action=' + (t.attr('checked') === 'checked' ? 'remove' : 'add'),
                 beforeSend: function() {
                     t.parent().next().addClass('rbac-waiting rbac-waiting-left');
                 },

views/items/child.php

             $.ajax({
                 type: 'POST',
                 url: '<?php echo $this->createUrl('child', array('type' => $type, 'parent' => $parent)); ?>',
-                data: 'child=' + t.val() + '&action=' + (t.attr('checked') == 'checked' ? 'remove' : 'add'),
+                data: 'child=' + t.val() + '&action=' + (t.attr('checked') === 'checked' ? 'remove' : 'add'),
                 beforeSend: function() {
                     t.parent().next().addClass('rbac-waiting rbac-waiting-left');
                 },
                 }
             });
         });
-    })
+    });
 </script>

views/items/index.php

             $.ajax({
                 type: 'POST',
                 url: '<?php echo $this->createUrl('items/setAllowedAuthItem'); ?>',
-                data: 'name=' + t.val() + '&action=' + (t.attr('checked') == 'checked' ? 'remove' : 'add'),
+                data: 'name=' + t.val() + '&action=' + (t.attr('checked') === 'checked' ? 'remove' : 'add'),
                 beforeSend: function() {
                     t.parent().next().addClass('rbac-waiting rbac-waiting-left');
                 },

views/layouts/base.php

         <script type="text/javascript">
             function beautifyCheckbox() {
                 $('input:checkbox').checkbox({cls: 'jquery-safari-checkbox', empty: '<?php echo $this->assetsUrl; ?>/jquery-checkbox/empty.png'});
+                $('input:checkbox').unbind('click');
             }
         </script>
     </body>