Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7965 from SAPlayer/disallow-empty-file-filter
Browse files Browse the repository at this point in the history
Don't allow creating empty file filters
  • Loading branch information
RaymondLim committed May 29, 2014
2 parents e12fcb6 + 364e0c9 commit e934f7f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/search/FileFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@ define(function (require, exports, module) {
});
}

// Code to enable/disable the OK button at the bottom of dialog (whether filter is empty or not)
var $primaryBtn = dialog.getElement().find(".primary");

function updatePrimaryButton() {
var trimmedValue = $editField.val().trim();

$primaryBtn.prop("disabled", !trimmedValue.length);
}

$editField.on("input", updatePrimaryButton);
updatePrimaryButton();

if (_context) {
$editField.on("input", _.debounce(updateFileCount, 400));
updateFileCount();
Expand Down

0 comments on commit e934f7f

Please sign in to comment.