You may have seen some new behavior in SharePoint online where Doc Icon links are not clickable in the document library after migration from SharePoint 2010 to SharePoint Online/SharePoint 2013.

The following code can be added as a CEWP in each document library View wherever you need clickable Doc Icon functionality. This is a generic script and can be added to any SharePoint library without making any changes.
  1. <script type="text/javascript">
  2. (function () {
  3. var replaceCtrl = {};
  4. replaceCtrl.Templates = {};
  5. replaceCtrl.Templates.Fields = { 'DocIcon': { 'View': CustomIcon } };
  6. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(replaceCtrl);
  7. })();
  8. function CustomIcon(ctx) {
  9. if (ctx.CurrentItem.FSObjType == '1') {
  10. var ret = "<a href=\"" + ctx.CurrentItem.FileRef + "\">" +
  11. "<img width='16' height='16' title=\"" + ctx.CurrentItem.FileLeafRef + "\" " +
  12. "class='ms-draggable' alt=\"" + ctx.CurrentItem.FileLeafRef + "\" " +
  13. "src=\"/_layouts/15/images/FOLDER.GIF\" border='0' DragId='0'/></a>";
  14. }
  15. else {
  16. var ret = "<a href=\"" + ctx.CurrentItem.FileRef + "\">" +
  17. "<img width='16' height='16' title=\"" + ctx.CurrentItem.FileLeafRef + "\" " +
  18. "class='ms-draggable' alt=\"" + ctx.CurrentItem.FileLeafRef + "\" " +
  19. "src=\"/_layouts/15/images/" + ctx.CurrentItem['HTML_x0020_File_x0020_Type.File_x0020_Type.mapico'] + "\" " +
  20. "border='0' DragId='0'/></a>";
  21. }
  22. return ret;
  23. }
  24. </script>