11

SharePoint 2013 introduced a new flyout on list items instead of a drop-down context menu. When you click the 3 dots next to a list item or document, you get the flyout. You then have to click the 3 dots on THAT flyout to get the normal old-fashioned context menu.

If at all possible, I need to eliminate that extra click and just have the first 3 dots open the full context menu for the item. I've been googling on this for three days with no success yet.

I'm not that keen of a developer yet, but if it can be done via JSLink, modifying OOTB JS files or CSS, I can probably figure it out with some guidance.

Is there a way to eliminate the middle-man here and just have the context/ECB menu open from the first 3-dot-click?

  • ms has the habit of adding html to the page only after items are clicked, which being the case, will not be an easy job. anyway, +1 for the question – Tiago Duarte Jul 30 '14 at 22:22
2

Ok, here are my 2 cents

CSS

<style>
/*bonus - show menu item icons*/
.ms-core-menu-link * {display: inline !important;}

/*hide the first flyout*/
.js-callout-mainElement{visibility:hidden;}
</style>

Script

<script>
$(document).ready(function(){

    //first click
    $('.ms-lstItmLinkAnchor').click(function(event){

        console.log('first click');

        //trigger second click
        if($(this).next('.js-callout-mainElement').length > 0)
        {
            console.log('unecessary first flyout found');

            //show the second flyout
            $(this).parent().children('.js-callout-mainElement').find('a.js-callout-action').trigger('click');
        }
        else
        {
            //first click will select the list item, second click (and future first clicks) will open context menu
            console.log('missing markup. cannot call flyout #2');
        }
    });
});
</script>

if you want to do some digging:

  1. go to 15\layouts
  2. backup clienttemplates.debug.js and clienttemplates.js
  3. copy clienttemplates.debug.js to clienttemplates.js
  4. play around with clienttemplates.js
0

I haven't used 2013 enough yet to say whether or not this is definitive. But looking at the results of clicking on a Site Contents link, I see anchor tags for the ellipsis with a class like this: ms-vl-calloutarrow ms-calloutLink ms-ellipsis-a ms-pivotControl-overflowDot js-callout-launchPoint

Now it seems to me you could create your own hover function with jQuery and tie it onto the masterpage, something like:

$(".ms-ellipsis-a").hover(function(){$(this).click();});
0

You can achieve this by editing the view through the UI. http://blog.incworx.com/blog/consulting-from-the-trenches/disable-call-out-menu-in-sharepoint-2013-document-libraries

Or do it with PowerShell Sharepoint 2013: How to customize context menu view in document library

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

0

You can use JSLink to solve this problem.

Register following JavaScript to you LinkFilename field via C#, PowerShell or any way. (I used C#.)

(function () {
    function RegisterFilenameFiledContext() {

        var linkFilenameFiledContext = {};
        linkFilenameFiledContext.Templates = {};
        linkFilenameFiledContext.Templates.Fields = {
            "LinkFilename": { "View": MyLinkFilenameNoMenu }
        };

        SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFilenameFiledContext);
    }
    function MyLinkFilenameNoMenu(renderCtx, field) {
        // prevent rendering CALLOUT
        field.CalloutMenu = undefined;

        return ComputedFieldWorker.LinkFilenameNoMenu(renderCtx, field);
    }
    RegisterFilenameFiledContext();
})();

How it works

As SharePoint renders CALLOUT according to field.CalloutMenu, just make it undefined.

clienttemplates.js

/* This calls rendering template. You can override by JSLink */
var retStr = field.fieldRenderer(renderCtx, field, listItem, listSchema);

/* many code here ... */

if (isCustomData == null || typeof isCustomData == 'undefined' || Boolean(isCustomData) == false) {
    if (field.CalloutMenu != null) {
        /* As CalloutMenu is set to undefined, this line will not be called */
        retStr = RenderCalloutMenu(renderCtx, listItem, field, retStr, IsCSRReadOnlyTabularView(renderCtx));
    }
    else if (field.listItemMenu != null) {
        /* This line will be called instead of RenderCalloutMenu */
        retStr = RenderECB(renderCtx, listItem, field, retStr, IsCSRReadOnlyTabularView(renderCtx));
    }
}
return retStr;

Hope this help you :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.