define([
    'require',
    '../../lib/chosen.jquery',
    '../logging'
], function(require) {
    var log = require('../logging').getLogger('breadcrumbs');

    var init = function($el, opts) {
        // wrap elements in a DIV that will be shifted around
        var $content = $el.children()
                .wrapAll('<div class="breadcrumbs-content"></div>').parent();

        // set fixed width on content
        var width = $content.children().toArray().reduce(function(acc, el) {
            return acc + $(el).outerWidth(true);
        }, 0);
        $content.width(width);

        // shift ctrl
        var $ctrl = $('<span class="button shift">shift</span>')
                .prependTo($el);

        var shifted = false,
            shifting = false,
            difference = 0;
        var shifter = function(toggle) {
            return function() {
                var margin;
                if (toggle) {
                    margin = shifted ? 0 : difference;
                    $content.animate({"margin-left": margin}, function() {
                        $ctrl.toggleClass('shift-right shift-left');
                        shifted = !shifted;
                    });
                } else {
                    margin = shifted ? difference : 0;
                    $content.css({"margin-left": margin});
                }
            };
        };

        var maybeshift = function() {
            // account for other stuff on the same line (100px)
            difference = $el.innerWidth() - $content.width() - 100;

            if (difference < 0) {
                // we should be shifting
                if (!shifting) {
                    shifting = true;
                    $el.addClass('shifting');
                    $ctrl.addClass('shift-left');
                    $ctrl.on('click.breadcrumbs', shifter(true));
                    $ctrl.click();
                } else {
                    // a shifter that keeps state
                    shifter(false)();
                }
            } else {
                // we should not be shifting
                if (shifting) {
                    if (shifted) $ctrl.click();
                    shifting = false;
                    $el.removeClass('shifting');
                    $ctrl.removeClass('shift-left shift-right');
                    $ctrl.off('.breadcrumbs');
                }
            }
        };
        maybeshift();
        $(window).on('resize.breadcrumbs', maybeshift);
    };

    var pattern = {
        markup_trigger: 'nav.breadcrumbs',
        init: init
    };
    return pattern;
});
@@ -1722,32 +1722,86 @@
 ss('shifting');%0A
+                    $ctrl.removeClass('shift-right');%0A
                 
@@ -1826,32 +1826,32 @@
 ('shift-left');%0A
-
                 
@@ -2188,36 +2188,103 @@
     
-if (shifted) $ctrl.click();%0A
+$content.animate(%7B%22margin-left%22: 0%7D, function() %7B%0A                        shifted = false;%0A    
     
@@ -2309,32 +2309,36 @@
 ifting = false;%0A
+    
                 
@@ -2382,32 +2382,36 @@
                 
+    
 $ctrl.removeClas
@@ -2455,24 +2455,28 @@
             
+    
 $ctrl.off('.
@@ -2486,24 +2486,48 @@
 adcrumbs');%0A
+                    %7D);%0A
             

fix breadcrumbs shifting classes