﻿$(function() {
    $('input').click(function() {
        // Resize Font in Article Panel //
        var maxSize = 20;
        var minSize = 9;
        var ourText = $('p', '#full-article');
        var currFontSize = ourText.css('fontSize');
        var newFontSize = parseFloat(currFontSize, 10);
        var stringEnding = currFontSize.slice(-2);
        if (this.id == 'large') {
            newFontSize *= 1.2;
        }
        else if (this.id == 'small') {
            newFontSize /= 1.2;
        }
        else if (this.id == 'default') {
            newFontSize = 12;
        }

        if (newFontSize >= maxSize) {
            newFontSize = maxSize;
        }
        else if (newFontSize <= minSize) {
            newFontSize = minSize;
        }
        // This script needs amending at some stage to take into account line-height //  
        ourText.css('fontSize', newFontSize + stringEnding);
    });
});