UPDATE February 13th, 2014: An even newer version is now available which you can check out here.
Another requirement of one of my users is to open file attachments directly by clicking on the paperclip icon without the detour of opening the item first. Alexander Bautz from spjsblog.com wrote the perfect script for this purpose which you can find here on his blog post. Thanks for that!
However, the last update was from mid 2012 and therefore the latest version is not compatible with SharePoint 2013. I made some minor adjustments to the code to restore the compatibility and I added a fade-in and fade-out animation, as well.
And here is how it will look like:
All you have to do is uploading this script to the Style Library (or any other document libary, SVN or the Hive ) and putting the following snippet into a CEWP or Script Editor Web Part on the page where you want to to have this functionality.
Please note: To make this script work, your list view has to have the ID column as well as the attachment column visible.
The four options you can see in the snippet above are as follows:
- hideIdColumn: Defines whether the ID column will be hidden or not
- clickToOpen: Defines whether you have to click in the paperclip in order to see the list of attached files or not
- clickMouseOver: Defines the text in the tooltip when you hover your mouse over the paperclip
- oneClickOpenIfSingle: Defines if an attachment is directly opened or not if it is the only attachment of the list item
Have fun with the script!
UPDATE February 12th, 2014: There was a small error in the script. Please download the script again if you have downloaded it before February the 12th, 2014. Alternatively you can fix the script yourself:
- Normal version: Replace line 24 with ‘var argPlaceholder;‘
- Minimized Version: Insert a space in line 23 at column 5263