Skip to:
Content

BuddyPress.org

Changeset 7114


Ignore:
Timestamp:
05/28/2013 01:38:50 AM (13 years ago)
Author:
boonebgorges
Message:

When leaving the "What's New" field, shrink if it's empty

Fixes #4364

Props SGr33n

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/js/buddypress.js

    r7002 r7114  
    4747                });
    4848                jq("#aw-whats-new-submit").prop("disabled", false);
     49        });
     50
     51        /* On blur, shrink if it's empty */
     52        jq('#whats-new').blur( function(){
     53                if (!this.value.match(/\S+/)) {
     54                        this.value = "";
     55                        jq("#whats-new-options").animate({
     56                                height:'40px'
     57                        });
     58                        jq("form#whats-new-form textarea").animate({
     59                                height:'20px'
     60                        });
     61                        jq("#aw-whats-new-submit").prop("disabled", true);
     62                }
    4963        });
    5064
  • trunk/bp-themes/bp-default/_inc/global.js

    r7002 r7114  
    4747                });
    4848                jq("#aw-whats-new-submit").prop("disabled", false);
     49        });
     50
     51        /* On blur, shrink if it's empty */
     52        jq('#whats-new').blur( function(){
     53                if (!this.value.match(/\S+/)) {
     54                        this.value = "";
     55                        jq("#whats-new-options").animate({
     56                                height:'40px'
     57                        });
     58                        jq("form#whats-new-form textarea").animate({
     59                                height:'20px'
     60                        });
     61                        jq("#aw-whats-new-submit").prop("disabled", true);
     62                }
    4963        });
    5064
Note: See TracChangeset for help on using the changeset viewer.