                 .removeClass(o.opts.wrappedClass)
                 .trigger "decompress.#{ pluginName }"
 
+        o.getChildrenWidth = ->
+            totalWidth = 0
+
+            o.el
+                .children()
+                .each ->
+                    totalWidth += ($ this).width()
+
+            return totalWidth
+
         o.generateRandomKey = ->
             Math
                 .random()


                if holder.length is 0
                    holder = ($ "<li class=\"#{ o.opts.holder.class }\"><a href=\"#\">#{ o.opts.holder.text }</a><ul class=\"clearfix\" /></li>").insertAfter items.first()

                # initialize an array for storage of the hidden items
                hiddenItems = []

                o.opts.onAfterCompress(_this) if $.isFunction(o.opts.onAfterCompress)

            # bind the element to a custom event named decompress
            o.el.on "decompress.#{ pluginName }", (e) ->
                current     = $ this
                holder      = current.find ".#{ o.opts.holder.class }"
                hiddenItems = holder.find 'ul > li'

                # set the state to decompressed
                current.data o.stateKey, 'decompressed'

                if hiddenItems.length > 0
                    hiddenItems = $ hiddenItems.get().reverse()

                    hiddenItems.each ->
                        crumb = $ this
                        width = crumb.data "#{ pluginName.toLowerCase() }-width"

                        if typeof width isnt "undefined" and (o.getChildrenWidth() + width) <= current.width()
                            holder.after crumb.detach()
                        else
                            return false

                holder.remove() if hiddenItems.length is 0

                o.opts.onDecompress(_this) if $.isFunction(o.opts.onDecompress)

                # delete the reference since the holder element have been remove already
                holder = null

                o.opts.onAfterDecompress(_this) if $.isFunction(o.opts.onAfterDecompress)

            o.browserWindow.on o.resizeKey, o.resize

