Skip to content

Instantly share code, notes, and snippets.

@potar
potar / radiobutton.js
Last active August 29, 2015 14:00
Modified 'radiolist'. Requires x-editable. Adds 'radiolist' option to x-editable where you can use radio inputs.
/**
* The idea was taken here https://github.com/vitalets/x-editable/issues/153
*
* We need to remove this code in the future because this functionality ('radiolist')
* will be in x-editable by default.
*
* You can use only json as a `source`:
* $('.editable-earn-method').editable({
* name: 'earn_method',
* source: {'1': 'Yes', '0': 'No'},
@potar
potar / custom.js
Created February 18, 2014 10:29 — forked from drewjoh/custom.js
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {