Added support for closing files on middle click
Fix a undefined exception
Removed unnecessary $.extend
Fixes after review
Changed to use .click instead of .on("click")
Merge pull request #3901 from WebsiteDeveloper/Issue-3889

Added support for closing files on middle click