0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

remove drag/drop for customizer

This commit is contained in:
Johann-S 2018-10-07 12:58:51 +02:00 committed by XhmikosR
parent d7ab2fbd5b
commit b304c61318
2 changed files with 2 additions and 18 deletions

View File

@ -17,7 +17,6 @@ window.onload = function () { // wait for load in a dumb way because B-0
' * Licensed under the MIT license\n' +
' */\n\n'
var supportsFile = window.File && window.FileReader && window.FileList && window.Blob
var $importDropTarget = $('#import-drop-target')
function showError(msg, err) {
@ -310,8 +309,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
e.stopPropagation()
e.preventDefault()
var file = e.originalEvent.hasOwnProperty('dataTransfer') ? e.originalEvent.dataTransfer.files[0] : e.originalEvent.target.files[0]
var file = e.originalEvent.target.files[0]
var reader = new FileReader()
reader.onload = function (e) {
@ -334,20 +332,6 @@ window.onload = function () { // wait for load in a dumb way because B-0
reader.readAsText(file, 'utf-8')
}
function handleConfigDragOver(e) {
e.stopPropagation()
e.preventDefault()
e.originalEvent.dataTransfer.dropEffect = 'copy'
removeImportAlerts()
}
if (supportsFile) {
$importDropTarget
.on('dragover', handleConfigDragOver)
.on('drop', handleConfigFileSelect)
}
$('#import-file-select').on('change', handleConfigFileSelect)
$('#import-manual-trigger').on('click', removeImportAlerts)

View File

@ -31,7 +31,7 @@ lead: Customize Bootstrap's components, Less variables, and jQuery plugins to ge
<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
</div>
<p class="lead">Have an existing configuration? Upload your <code>config.json</code> to import it.</p>
<p>Drag and drop here, or <label id="import-manual-trigger" class="btn-link">manually upload<input type="file" id="import-file-select" class="hidden"></label>.</p>
<p><label id="import-manual-trigger" class="btn-link">Upload<input type="file" id="import-file-select" class="hidden"></label>.</p>
<hr>
<p><strong>Don't have one?</strong> That's okay—just start customizing the fields below.</p>
</div>