]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/postbox.dev.js
Wordpress 3.2
[autoinstalls/wordpress.git] / wp-admin / js / postbox.dev.js
index 54f93666b72e5ea7281efba6c1f6fee40c32b335..b367d916ac8967014b34d02c00713fd49ed15732 100644 (file)
@@ -5,6 +5,8 @@ var postboxes;
                        this.init(page,args);
                        $('.postbox h3, .postbox .handlediv').click( function() {
                                var p = $(this).parent('.postbox'), id = p.attr('id');
+                               if ( 'dashboard_browser_nag' == id )
+                                       return;
 
                                p.toggleClass('closed');
                                postboxes.save_state(page);
@@ -18,10 +20,15 @@ var postboxes;
                        $('.postbox h3 a').click( function(e) {
                                e.stopPropagation();
                        } );
+                       $('.postbox a.dismiss').click( function(e) {
+                               var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
+                               $( '#' + hide_id ).prop('checked', false).triggerHandler('click');
+                               return false;
+                       } );
                        $('.hide-postbox-tog').click( function() {
                                var box = $(this).val();
 
-                               if ( $(this).attr('checked') ) {
+                               if ( $(this).prop('checked') ) {
                                        $('#' + box).show();
                                        if ( $.isFunction( postboxes.pbshow ) )
                                                postboxes.pbshow( box );
@@ -93,24 +100,18 @@ var postboxes;
                                forcePlaceholderSize: true,
                                helper: 'clone',
                                opacity: 0.65,
-                               start: function(e,ui) {
-                                       $('body').css({
-                                               WebkitUserSelect: 'none',
-                                               KhtmlUserSelect: 'none'
-                                       });
-                                       /*
-                                       if ( $.browser.msie )
-                                               return;
-                                       ui.item.addClass('noclick');
-                                       */
-                               },
                                stop: function(e,ui) {
+                                       if ( $(this).find('#dashboard_browser_nag').is(':visible') && 'dashboard_browser_nag' != this.firstChild.id ) {
+                                               $(this).sortable('cancel');
+                                               return;
+                                       }
+
                                        postboxes.save_order(page);
                                        ui.item.parent().removeClass('temp-border');
-                                       $('body').css({
-                                               WebkitUserSelect: '',
-                                               KhtmlUserSelect: ''
-                                       });
+                               },
+                               receive: function(e,ui) {
+                                       if ( 'dashboard_browser_nag' == ui.item[0].id )
+                                               $(ui.sender).sortable('cancel');
                                }
                        });
                },