How to use the ladda/js/ladda.create function in ladda

To help you get started, we’ve selected a few ladda examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DragonsInn / BIRD3 / app / Frontend / Upload.js View on Github external
UPLOAD_ERR_FORM_SIZE: 2,
    UPLOAD_ERR_PARTIAL: 3,
    UPLOAD_ERR_NO_FILE: 4,
    UPLOAD_ERR_NO_TMP_DIR: 6,
    UPLOAD_ERR_CANT_WRITE: 7,
    UPLOAD_ERR_EXTENSION: 8,
    // BIRD3 specific
    UPLOAD_IMG_CANT_RESIZE: -1,
    UPLOAD_IMG_UNSUPPORTED: -2,
    UPLOAD_FILETYPE_MISMATCH: -3,
    UPLOAD_ERROR_SAVE: -4
};

// Refferences to buttons
var $button = document.getElementById("upload_trigger");
var $ladda = ladda.create($button);
var $input = document.getElementById("upload_holder");
var $fd = document.getElementById("filedrop");

// Zoooooooone o.o
var zone = window.zone = new filedrop.FileDrop($fd, {
    iframe: {
        url: location.href,
        fileParam: "image"
    },
    //input: $input,
    multiple: false
});

// Set up an additional handler for the button, cause the button is a derp.
var $fdInput = zone.findInputRecursive(zone.zone);
$button.click(function(e){
github DragonsInn / BIRD3 / web-lib / upload.js View on Github external
UPLOAD_ERR_FORM_SIZE: 2,
    UPLOAD_ERR_PARTIAL: 3,
    UPLOAD_ERR_NO_FILE: 4,
    UPLOAD_ERR_NO_TMP_DIR: 6,
    UPLOAD_ERR_CANT_WRITE: 7,
    UPLOAD_ERR_EXTENSION: 8,
    // BIRD3 specific
    UPLOAD_IMG_CANT_RESIZE: -1,
    UPLOAD_IMG_UNSUPPORTED: -2,
    UPLOAD_FILETYPE_MISMATCH: -3,
    UPLOAD_ERROR_SAVE: -4
};

// Refferences to buttons
var $button = document.getElementById("upload_trigger");
var $ladda = ladda.create($button);
var $input = document.getElementById("upload_holder");
var $fd = document.getElementById("filedrop");

// Zoooooooone o.o
var zone = window.zone = new filedrop.FileDrop($fd, {
    iframe: {
        url: location.href,
        fileParam: "image"
    },
    //input: $input,
    multiple: false
});

// Set up an additional handler for the button, cause the button is a derp.
var $fdInput = zone.findInputRecursive(zone.zone);
$button.click(function(e){

ladda

Buttons with built-in loading indicators

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis

Similar packages