Commit f45900e8 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Use Store#findExact instead of Store#find.

Otherwise we will find "Ext" from store that only contains "Ext.Array".
parent 4916d233
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ Ext.define("Docs.Favorites", {
     */
    remove: function(cls) {
        if (this.has(cls)) {
            this.store.removeAt(this.store.find('cls', cls));
            this.store.removeAt(this.store.findExact('cls', cls));
            if (this.localStorage) this.store.sync();
        }
    },
@@ -47,7 +47,7 @@ Ext.define("Docs.Favorites", {
     * @return {Boolean} true when class exists in favorites.
     */
    has: function(cls) {
        return this.store.find('cls', cls) > -1;
        return this.store.findExact('cls', cls) > -1;
    }

});
+5 −5
Original line number Diff line number Diff line
@@ -73,9 +73,9 @@ Ext.define("Docs.History", {
        if (cls) {
            // When class already in history remove it and add again.
            // This way the most recently visited items will always be at the top.
            var oldItem = this.store.findRecord('cls', cls);
            if (oldItem) {
                this.store.remove(oldItem);
            var oldIndex = this.store.findExact('cls', cls);
            if (oldIndex > -1) {
                this.store.removeAt(oldIndex);
            }

            // Add new item at the beginning
@@ -95,7 +95,7 @@ Ext.define("Docs.History", {
     * @param {String} cls
     */
    removeClass: function(cls) {
        var index = this.store.find('cls', cls);
        var index = this.store.findExact('cls', cls);
        this.store.removeAt(index);
        if (this.localStorage) this.store.sync();
    }