Sha256: b71787001b357f8f348b7ad012dd3e45b2fb5cb0d8deb84cbeae87bc9f2d853a
Contents?: true
Size: 1.22 KB
Versions: 11
Compression:
Stored size: 1.22 KB
Contents
;(function($){ var MIN = 13; var MAX = 17; var DEFAULT = 15; var p = Application.params.font_size; var pi = parseInt(p); var size = ((!isNaN(p) && pi <= MAX && pi >= MIN)) ? pi : DEFAULT; $.fn.resizeable = function() { function set(size, notify) { // set size $('.resizeable_text').css('font-size', get_px(size) + "px"); // reset disabled state $('.resizeable').removeClass('disabled'); // set disabled state if (size === MIN) $('.resizeable.down').addClass('disabled'); if (size === MAX) $('.resizeable.up').addClass('disabled'); // notify the client of the size if (notify) Client.notify({ 'font_size': size }); return size; } function handlers(el) { el .unbind("click") .bind("click", function() { var new_size = size + parseInt($(this).data('dir'), 10); if (new_size <= MAX && new_size >= MIN) { size = set(new_size, true); } }); } set(size, false); handlers(this); return this; }; })(Zepto);
Version data entries
11 entries across 11 versions & 1 rubygems