2

I've figured out how to disable drag and drop functionality on my document list. The problem is, it still says "or drag files here" text beside the +new document link. I want to keep the +new document, just get rid of the rest.

4

This is a real ugly solution as the text could still be visible if you use markup.

Add a script editor to the same page as the document library and add this.

<style type="text/css">
.ms-soften, .ms-soften:link, a.ms-soften:visited, .ms-soften:hover, .ms-soften:active
{
color: #fff;
cursor: default;
}
</style>
  • In addition your can add properties like display: none or visibility: hidden – Aveenav Apr 1 '16 at 18:31
  • @Aveenav Not for this one, as it would hide the button "+ New Document" to. :) – Christoffer Apr 4 '16 at 7:40
0

Try this with jQuery. I haven't tested this myself so you may need to tweak it.

var a = $("a[id^='idHomePageNewDocument']");
var aParent = a.parent();
a.remove();
aParent.html("");
aParent.append(a);

You'll need to add a reference to the jQuery library on your document library's view page (every view page of the document library, in fact). And you'll need to add a reference to a second JavaScript file that contains the above code or add the code directly using a Content Editor or Script Editor web part.

0

I had this same issue. I was able to remove the text using this script. It removes the text from the td element, but leaves the child elements alone.

$("td.ms-list-addnew").contents().filter(function(){
    return (this.nodeType == 3);
}).remove();

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.