0

I am using a tab panel WebPart that was given to me complete. The jQuery is repeating every-time the WebPart is edited so, the tabs repeat or get multiplied. I am using static information to populate the tabs. This does not happen when I am working in a publishing page unless I specifically click on the edit web part.

  • 1
    Without the code of the webpart it will be almost impossible to help you – Robert Lindgren Sep 28 '16 at 18:01
1

SharePoint adds a hidden control with a value which tells the client side code if the page or WebParts on that page are in Edit Mode.

In case of Wiki Pages, the id of the control is _wikiPageMode and in case of Publishing pages, it is MSOLayout_InDesignMode.

You can put your code inside an if statement like below to know if your page is in design mode and stop execution of code.

if($("#_wikiPageMode").val() "Edit" or "" ||
      $("#MSOLayout_InDesignMode").val() "1" or "") {

      //Your existing code here
}

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.